/// <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); }
/// <summary> </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { string localStatus = "FAILED"; IList <string> _dcmInstanceIds = StructureSetIds.Get(context); int nDcmInstanceId = 0; string isocenterCoordinates = ""; IList <string> spatialIsocenters = new List <string>(); context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this); ActivityStatus.Set(context, localStatus); foreach (string dcmInstance in _dcmInstanceIds) { nDcmInstanceId = Convert.ToInt32(dcmInstance); isocenterCoordinates = _processSpatialRegistrationObject.ExtractSpatialIsocenterCoordinates(nDcmInstanceId); spatialIsocenters.Add(isocenterCoordinates); } localStatus = "SUCCESS"; SpatialIsocenterCoordinates.Set(context, spatialIsocenters); ActivityStatus.Set(context, localStatus); }