Esempio n. 1
0
        /// <summary> </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            string localStatus       = "FAILED";
            string sroDcmInstanceId  = SroUnitId.Get(context);
            int    nSroDcmInstanceId = Convert.ToInt32(sroDcmInstanceId);

            string rpsDcmInstanceId  = RpsUnitId.Get(context);
            int    nRpsDcmInstanceId = Convert.ToInt32(rpsDcmInstanceId);

            IList <string> planningImageSopInstanceUidValues     = new List <string>();
            IList <string> verificationImageSopInstanceUidValues = new List <string>();


            context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this);

            _processSpatialRegistrationObject.ParseXVI5xSpatialRegistration(nSroDcmInstanceId, nRpsDcmInstanceId,
                                                                            ref planningImageSopInstanceUidValues, ref verificationImageSopInstanceUidValues);

            // did we successfully extract the lists of image sop instance uids ?
            if (planningImageSopInstanceUidValues.Count > 0 && verificationImageSopInstanceUidValues.Count > 0)
            {
                localStatus = "SUCCESS";
            }

            PlanningImageSopInstanceValues.Set(context, planningImageSopInstanceUidValues);
            VerificationImageSopInstanceValues.Set(context, verificationImageSopInstanceUidValues);
            ActivityStatus.Set(context, localStatus);
        }
Esempio n. 2
0
        /// <summary> </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            string                  localStatus                           = "FAILED";
            string                  _dcmInstanceId                        = UnitId.Get(context);
            int                     nDcmInstanceId                        = Convert.ToInt32(_dcmInstanceId);
            IList <string>          sourceFrameOfReferenceUid             = new List <string>();
            string                  targetFrameOfReferenceUid             = "";
            IList <IList <double> > transformationMatrix                  = new List <IList <double> >();
            IList <string>          transformationComment                 = new List <string>();
            IList <int>             planningImageIdValues                 = new List <int>();
            IList <string>          planningImageSopInstanceUidValues     = new List <string>();
            IList <string>          planningFrameOfReferenceUidValues     = new List <string>();
            IList <string>          verificationImageSopInstanceUidValues = new List <string>();
            string                  spatialRegistrationType               = SpatialRegistrationObjectType.Get(context);
            IList <string>          _structureSetIds                      = StructureSetIds.Get(context);
            IList <string>          structureSetIds;

            if (spatialRegistrationType == "3D" && _structureSetIds != null && _structureSetIds.Count > 0)
            {
                structureSetIds = _structureSetIds;
            }
            else
            {
                structureSetIds = new List <string>();
            }
            byte nRegistrationType = 0;

            context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this);

            _processSpatialRegistrationObject.ParseTreatmentDeliverySpatialRegistration(nDcmInstanceId, spatialRegistrationType, structureSetIds, ref sourceFrameOfReferenceUid, ref targetFrameOfReferenceUid, ref transformationMatrix, ref transformationComment, ref planningImageSopInstanceUidValues, ref planningImageIdValues, ref planningFrameOfReferenceUidValues, ref verificationImageSopInstanceUidValues, ref nRegistrationType);

            if (sourceFrameOfReferenceUid != null && sourceFrameOfReferenceUid.Count > 0)
            {
                localStatus = "SUCCESS";
            }

            SourceFrameOfReferenceUID.Set(context, sourceFrameOfReferenceUid);
            TargetFrameOfReferenceUID.Set(context, targetFrameOfReferenceUid);
            TransformationMatrix.Set(context, transformationMatrix);
            TransformationMatrixComment.Set(context, transformationComment);
            PlanningImageSopInstanceValues.Set(context, planningImageSopInstanceUidValues);
            PlanningImageIdValues.Set(context, planningImageIdValues);
            PlanningImageFrameOfReferenceUidValues.Set(context, planningFrameOfReferenceUidValues);
            VerificationImageSopInstanceValues.Set(context, verificationImageSopInstanceUidValues);
            RegistrationType.Set(context, nRegistrationType);
            ActivityStatus.Set(context, localStatus);
        }