/// <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>();
            byte                    nRegistrationType         = 0;

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

            _processSpatialRegistrationObject.ParseTreatmentPlanningSpatialRegistration(nDcmInstanceId, ref sourceFrameOfReferenceUid, ref targetFrameOfReferenceUid, ref transformationMatrix, ref transformationComment, 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);
            RegistrationType.Set(context, nRegistrationType);
            ActivityStatus.Set(context, localStatus);
        }
Exemple #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);
        }