コード例 #1
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);
            byte                    nRegistrationType         = RegistrationType.Get(context);
            string                  _manufacturer             = Manufacturer.Get(context);
            string                  _model                    = ModelName.Get(context);
            string                  _softwareVersion          = SoftwareVersions.Get(context);
            IList <string>          sourceFrameOfReferenceUid = SourceFrameOfReferenceUID.Get(context);
            string                  targetFrameOfReferenceUid = TargetFrameOfReferenceUID.Get(context);
            IList <IList <double> > transformationMatrix      = TransformationMatrix.Get(context);
            IList <string>          transformationComment     = TransformationMatrixComment.Get(context);
            string                  _offsetId                 = OffsetID.Get(context);
            int                     nOffsetId                 = 0;

            if (_offsetId.Length > 0)
            {
                nOffsetId = Convert.ToInt32(_offsetId);
            }

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

            try
            {
                _processSpatialRegistrationObject.CreateRegistrationRecord(nDcmInstanceId, transformationMatrix, transformationComment, sourceFrameOfReferenceUid, targetFrameOfReferenceUid, nRegistrationType, _manufacturer, _model, _softwareVersion, nOffsetId);
                localStatus = "SUCCESS";
                ActivityStatus.Set(context, localStatus);
            }
            catch (Exception ex)
            {
                ActivityStatus.Set(context, localStatus);
            }
        }
コード例 #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>();
            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);
        }
コード例 #3
0
        /// <summary> </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            IList <string>          sourceFrameOfReferenceUid = SourceFrameOfReferenceUID.Get(context);
            string                  targetFrameOfReferenceUid = TargetFrameOfReferenceUID.Get(context);
            IList <IList <double> > transformationMatrix      = TransformationMatrix.Get(context);
            IList <string>          transformationComment     = TransformationMatrixComment.Get(context);
            int frameOfReferenceRecordId = 0;

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

            _processSpatialRegistrationObject.CreateFrameOfRefRelationshipRecord(transformationMatrix, transformationComment, sourceFrameOfReferenceUid, targetFrameOfReferenceUid, ref frameOfReferenceRecordId);

            FrameOfReferenceRecordId.Set(context, frameOfReferenceRecordId);
        }
コード例 #4
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);
        }
コード例 #5
0
        /// <summary> </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            string         sourceFrameOfReferenceUid = SourceFrameOfReferenceUID.Get(context);
            string         targetFrameOfReferenceUid = TargetFrameOfReferenceUID.Get(context);
            IList <double> transformationMatrix      = TransformationMatrix.Get(context);
            string         transformationComment     = TransformationMatrixComment.Get(context);
            int            frameOfReferenceRecordId  = FrameOfReferenceId.Get(context);

            int newFrameOfReferenceRecordId = 0;

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

            // Update the frame of reference relationship record
            //_processSpatialRegistrationObject.UpdateFrameOfRefRelationshipRecord(frameOfReferenceRecordId, transformationMatrix.ToArray(), transformationComment, sourceFrameOfReferenceUid);

            UpdatedFrameOfReferenceRecordId.Set(context, newFrameOfReferenceRecordId);
        }