コード例 #1
0
ファイル: DoseMatrix.cs プロジェクト: Baasanjav/Evil-DICOM
 public DoseMatrix(DICOMObject dcm)
 {
     _doseObject = new DICOMSelector(dcm);
     ValueSizeInBytes = _doseObject.BitsStored.Data / 8;
     DoseValues = new List<double>();
     this.Scaling= _doseObject.DoseGridScaling.Data;
     using (var stream = _doseObject.ToDICOMObject().PixelStream)
     {
         var binReader = new BinaryReader(stream);
         if (ValueSizeInBytes == 4)
         {
             while (binReader.BaseStream.Position < binReader.BaseStream.Length)
             {
                 DoseValues.Add(Scaling * binReader.ReadInt32());
             }
         }
         else
         {
             while (binReader.BaseStream.Position < binReader.BaseStream.Length)
             {
                 DoseValues.Add(Scaling * binReader.ReadUInt16());
             }
         }
     }
 }
コード例 #2
0
        private void calculprescription(String nom)
        {
            var dcm = DICOMObject.Read(nom);
            var sel = new DICOMSelector(dcm);

            try
            {
                var PrescripDose = sel.TargetPrescriptionDose.Data;
                var DoseFraction = sel.NumberOfFractionsPlanned.Data;

                var DoseParSeance = PrescripDose / DoseFraction;

                Console.WriteLine("- Dose totale prescrite : " + PrescripDose);
                Console.WriteLine("- Nombre de séance :  " + DoseFraction);
                Console.WriteLine("- Dose par séance : " + DoseParSeance);

                var BeamDoseSpec = sel.BeamDoseSpecificationPoint_;

                // nombre de dose
                var NbBeamDoseSpec = sel.BeamDoseSpecificationPoint_.Count;
                //var NbBeamDoseSpec = 3;

                for (int i = 0; i < BeamDoseSpec.Count; i++)
                {
                    sel.BeamDoseSpecificationPoint_[i].Data_.Clear();
                }
                Console.WriteLine("- Les " + sel.BeamDoseSpecificationPoint_.Count + " champs 'Beam Dose Spécifation Point' sont maintenant vides ");

                var numberDose_nar = DoseParSeance / NbBeamDoseSpec;
                var numberDose     = Math.Round(numberDose_nar, 3);

                Console.WriteLine("- Pondération par faisceau : " + numberDose);

                var beamdose   = sel.BeamDose_;
                var nbBeamDose = beamdose.Count - 1;
                for (int i = 0; i < beamdose.Count; i++)
                {
                    for (int k = 0; i < beamdose.Count; i++)
                    {
                        sel.BeamDose_[i].Data_[k] = numberDose;

                        if (nbBeamDose == i)
                        {
                            var total     = numberDose * nbBeamDose;
                            var totallast = DoseParSeance - total;
                            sel.BeamDose_[i].Data_[k] = totallast;
                        }
                        Console.WriteLine("Faisceau " + i + " : " + sel.BeamDose_[i].Data_[k]);
                    }
                }
            }
            catch (NullReferenceException)
            {
                MessageBox.Show("Impossible de calculer la dose pour le fichier " + nom, "Erreur", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                status.ForeColor = System.Drawing.Color.Red;
                status.Text      = "Modification interrompu";
                test             = false;
            };
            dcm.Write(nom);
        }
コード例 #3
0
 public RTDose(DICOMObject dcm)
 {
     _doseObject      = new DICOMSelector(dcm);
     ValueSizeInBytes = _doseObject.Bits​Stored.Data / 8;
     DoseValues       = new List <double>();
     Scaling          = _doseObject.Dose​Grid​Scaling.Data;
     using (var stream = _doseObject.ToDICOMObject().GetPixelStream())
     {
         var binReader = new BinaryReader(stream);
         if (ValueSizeInBytes == 4)
         {
             while (binReader.BaseStream.Position < binReader.BaseStream.Length)
             {
                 DoseValues.Add(Scaling * binReader.ReadInt32());
             }
         }
         else
         {
             while (binReader.BaseStream.Position < binReader.BaseStream.Length)
             {
                 DoseValues.Add(Scaling * binReader.ReadUInt16());
             }
         }
     }
 }
コード例 #4
0
 public AbstractDIMSERequest(DICOMObject d)
 {
     var sel = new DICOMSelector(d);
     GroupLength = sel.CommandGroupLength.Data;
     AffectedSOPClassUID = sel.AffectedSOPClassUID.Data;
     MessageID = sel.MessageID.Data;
     DataSetType = sel.CommandDataSetType.Data;
 }
コード例 #5
0
        protected virtual void CopyTreatmentMachineSequence(DICOMObject fromPatientPlan, DICOMObject toVerificationPlan)
        {
            var patientSelector      = new DICOMSelector(fromPatientPlan);
            var verificationSelector = new DICOMSelector(toVerificationPlan);

            var machineSeq = patientSelector.TreatmentMachineSequence;

            verificationSelector.TreatmentMachineSequence = machineSeq;
        }
コード例 #6
0
        public AbstractDIMSERequest(DICOMObject d)
        {
            var sel = new DICOMSelector(d);

            GroupLength         = sel.CommandGroupLength.Data;
            AffectedSOPClassUID = sel.AffectedSOPClassUID.Data;
            MessageID           = sel.MessageID.Data;
            DataSetType         = sel.CommandDataSetType.Data;
        }
コード例 #7
0
ファイル: MyDicom.cs プロジェクト: crisguycabs/origin
 /// <summary>
 /// Constructor por defecto
 /// </summary>
 public MyDicom()
 {
     minPixVal = 0;
     signedImage = false;
     bmp = null;
     pixelData = new List<ushort>();
     dcm = null;
     selector = null;
 }
コード例 #8
0
        protected virtual void CopyFractionGroupSeq(DICOMObject patientPlan, DICOMObject verificationPlan)
        {
            var patientSelector      = new DICOMSelector(patientPlan);
            var verificationSelector = new DICOMSelector(verificationPlan);

            var fractionSeq = patientSelector.FractionGroupSequence;

            verificationSelector.FractionGroupSequence = fractionSeq;
        }
コード例 #9
0
ファイル: CFindRequest.cs プロジェクト: rexcardan/Evil-DICOM
 public CFindRequest(DICOMObject d)
 {
     var sel = new DICOMSelector(d);
     GroupLength = sel.CommandGroupLength.Data;
     AffectedSOPClassUID = sel.AffectedSOPClassUID.Data;
     CommandField = (ushort)C.C_FIND_RQ;
     MessageID = sel.MessageID.Data;
     Priority = sel.Priority.Data;
     DataSetType = sel.CommandDataSetType.Data;
 }
コード例 #10
0
        protected virtual void UpdateVerificationPlanLabel(DICOMObject patientPlan, DICOMObject verificationPlan)
        {
            var patientSelector      = new DICOMSelector(patientPlan);
            var verificationSelector = new DICOMSelector(verificationPlan);

            var patientLabel = patientSelector.RTPlanLabel;

            verificationSelector.RTPlanLabel.Data += " - " + patientLabel.Data;
            verificationSelector.RTPlanName.Data   = verificationSelector.RTPlanLabel.Data;
        }
コード例 #11
0
ファイル: CGetRequest.cs プロジェクト: zzti/Evil-DICOM
        public CGetRequest(DICOMObject d)
        {
            var sel = new DICOMSelector(d);

            GroupLength         = sel.CommandGroupLength.Data;
            AffectedSOPClassUID = sel.AffectedSOPClassUID.Data;
            CommandField        = (ushort)C.C_MOVE_RQ;
            MessageID           = sel.MessageID.Data;
            Priority            = sel.Priority.Data;
            DataSetType         = sel.CommandDataSetType.Data;
        }
コード例 #12
0
 public AbstractDIMSEResponse(DICOMObject d)
 {
     var sel = new DICOMSelector(d);
     GroupLength = sel.CommandGroupLength.Data;
     if (sel.AffectedSOPClassUID != null)
     {
         AffectedSOPClassUID = sel.AffectedSOPClassUID.Data;
     };
     MessageIDBeingResponsedTo = sel.MessageIDBeingRespondedTo.Data;
     DataSetType = sel.CommandDataSetType.Data;
     Status = sel.Status.Data;
 }
コード例 #13
0
ファイル: NActionRequest.cs プロジェクト: zzti/Evil-DICOM
        public NActionRequest(DICOMObject d)
        {
            CommandField = (ushort)N_ACTION_RQ;
            var sel = new DICOMSelector(d);

            GroupLength             = sel.CommandGroupLength.Data;
            RequestedSOPClassUID    = sel.RequestedSOPClassUID.Data;
            RequestedSOPInstanceUID = sel.RequestedSOPInstanceUID.Data;
            CommandField            = sel.CommandField.Data;
            MessageID    = sel.MessageID.Data;
            DataSetType  = sel.CommandDataSetType.Data;
            ActionTypeID = sel.ActionTypeID.Data;
        }
コード例 #14
0
        public NEventReportRequest(DICOMObject d)
        {
            CommandField = (ushort)N_EVENT_REPORT_RQ;
            var sel = new DICOMSelector(d);

            GroupLength            = sel.CommandGroupLength.Data;
            AffectedSOPClassUID    = sel.AffectedSOPClassUID.Data;
            AffectedSOPInstanceUID = sel.AffectedSOPInstanceUID.Data;
            CommandField           = sel.CommandField.Data;
            MessageID   = sel.MessageID.Data;
            DataSetType = sel.CommandDataSetType.Data;
            EventTypeId = sel.EventTypeID.Data;
        }
コード例 #15
0
ファイル: CEchoResponse.cs プロジェクト: DMIAOCHEN/Evil-DICOM
 public CEchoResponse(DICOMObject d)
 {
     var sel = new DICOMSelector(d);
     GroupLength = sel.CommandGroupLength.Data;
     if (sel.AffectedSOPClassUID != null)
     {
         AffectedSOPClassUID = sel.AffectedSOPClassUID.Data;
     };
     CommandField = (ushort)C.C_ECHO_RP;
     MessageIDBeingResponsedTo = sel.MessageIDBeingRespondedTo.Data;
     DataSetType = sel.CommandDataSetType.Data;
     Status = sel.Status.Data;
 }
コード例 #16
0
        public AbstractDIMSEResponse(DICOMObject d)
        {
            var sel = new DICOMSelector(d);

            GroupLength = sel.CommandGroupLength.Data;
            if (sel.AffectedSOPClassUID != null)
            {
                AffectedSOPClassUID = sel.AffectedSOPClassUID.Data;
            }
            ;
            MessageIDBeingRespondedTo = sel.MessageIDBeingRespondedTo.Data;
            DataSetType = sel.CommandDataSetType.Data;
            Status      = sel.Status.Data;
        }
コード例 #17
0
ファイル: CStoreRequest.cs プロジェクト: Baasanjav/Evil-DICOM
 public CStoreRequest(DICOMObject d)
 {
     var sel = new DICOMSelector(d);
     GroupLength = sel.CommandGroupLength.Data;
     AffectedSOPClassUID = sel.AffectedSOPClassUID.Data;
     CommandField = sel.CommandField.Data;
     MessageID = sel.MessageID.Data;
     Priority = sel.Priority.Data;
     DataSetType = sel.CommandDataSetType.Data;
     AffectedSOPInstanceUID = sel.AffectedSOPInstanceUID.Data;
     MoveOrigAETitle = sel.MoveOriginatorApplicationEntityTitle != null
         ? sel.MoveOriginatorApplicationEntityTitle.Data
         : "";
     MoveOrigMessageID = sel.MoveOriginatorMessageID != null ? sel.MoveOriginatorMessageID.Data : default(ushort);
 }
コード例 #18
0
ファイル: CEchoResponse.cs プロジェクト: tlaneh/Evil-DICOM
        public CEchoResponse(DICOMObject d)
        {
            var sel = new DICOMSelector(d);

            GroupLength = sel.CommandGroupLength.Data;
            if (sel.AffectedSOPClassUID != null)
            {
                AffectedSOPClassUID = sel.AffectedSOPClassUID.Data;
            }
            ;
            CommandField = (ushort)C.C_ECHO_RP;
            MessageIDBeingRespondedTo = sel.MessageIDBeingRespondedTo.Data;
            DataSetType = sel.CommandDataSetType.Data;
            Status      = sel.Status.Data;
        }
コード例 #19
0
ファイル: NActionResponse.cs プロジェクト: zzti/Evil-DICOM
        public NActionResponse(DICOMObject d)
        {
            CommandField = (ushort)N_ACTION_RP;
            var sel = new DICOMSelector(d);

            GroupLength               = sel.CommandGroupLength.Data;
            AffectedSOPClassUID       = sel.AffectedSOPClassUID.Data;
            AffectedSOPInstanceUID    = sel.AffectedSOPInstanceUID.Data;
            MessageIDBeingRespondedTo = sel.MessageIDBeingRespondedTo.Data;
            DataSetType               = sel.CommandDataSetType.Data;
            Status = sel.Status.Data;
            if (sel.ActionTypeID != null)
            {
                ActionTypeID = sel.ActionTypeID.Data;
            }
        }
コード例 #20
0
ファイル: CStoreRequest.cs プロジェクト: top501/Evil-DICOM
        public CStoreRequest(DICOMObject d)
        {
            var sel = new DICOMSelector(d);

            GroupLength            = sel.CommandGroupLength.Data;
            AffectedSOPClassUID    = sel.AffectedSOPClassUID.Data;
            CommandField           = sel.CommandField.Data;
            MessageID              = sel.MessageID.Data;
            Priority               = sel.Priority.Data;
            DataSetType            = sel.CommandDataSetType.Data;
            AffectedSOPInstanceUID = sel.AffectedSOPInstanceUID.Data;
            MoveOrigAETitle        = sel.MoveOriginatorApplicationEntityTitle != null
                ? sel.MoveOriginatorApplicationEntityTitle.Data
                : "";
            MoveOrigMessageID = sel.MoveOriginatorMessageID != null ? sel.MoveOriginatorMessageID.Data : default(ushort);
        }
コード例 #21
0
        protected virtual void CopyApplicationSetupSequence(DICOMObject patientPlan,
                                                            DICOMObject verificationPlan,
                                                            int fromChannelNumber,
                                                            int toChannelNumber)
        {
            int numberOfChannelsInValidationPlan = toChannelNumber - fromChannelNumber;
            var patientSelector      = new DICOMSelector(patientPlan);
            var verificationSelector = new DICOMSelector(verificationPlan);

            var totalReferenceAirKerma = patientSelector.TotalReferenceAirKerma;

            verificationSelector.TotalReferenceAirKerma = totalReferenceAirKerma;

            var channelSeq = patientSelector.ChannelSequence;
            int channelId  = 1;

            foreach (var item in channelSeq.Data_)
            {
                var itemSelector  = new DICOMSelector(item);
                var channelNumber = itemSelector.ChannelNumber;

                if (channelNumber != null)
                {
                    bool bInsideTheBlock = IsInsideTheChannelBlock(channelNumber.Data,
                                                                   fromChannelNumber,
                                                                   toChannelNumber);
                    if (!bInsideTheBlock)
                    {
                        continue;
                    }

                    var numberOfControlPoints     = itemSelector.NumberOfControlPoints;
                    var channelLength             = itemSelector.ChannelLength;
                    var channelTotalTime          = itemSelector.ChannelTotalTime;
                    var sourceApplicatorLength    = itemSelector.SourceApplicatorLength;
                    var sourceApplicatorStep      = itemSelector.SourceApplicatorStepSize;
                    var finalCumulativeTimeweight = itemSelector.FinalCumulativeTimeWeight;
                    var brachyControlPointSeq     = itemSelector.BrachyControlPointSequence;

                    UpdateTarget(verificationSelector, channelNumber, numberOfControlPoints, channelLength,
                                 channelTotalTime, sourceApplicatorLength, sourceApplicatorStep,
                                 finalCumulativeTimeweight, brachyControlPointSeq, channelId);
                    ++channelId;
                }
            }
        }
コード例 #22
0
ファイル: DICOMhandler.cs プロジェクト: rickardcronholm/EQD
        public void UpdatePlan()
        {
            string description = "EGD2 generated from " + this.planUID + "\r\nα/β = " + this.alphaBeta.ToString();
            var    sel         = new DICOMSelector(plan);

            if (sel.RTPlanDescription == null)
            {
                sel.RTPlanDescription = new ShortText(TagHelper.RTPLAN_DESCRIPTION, description);
            }
            else
            {
                sel.RTPlanDescription.Data += description;
            }
            sel.SOPInstanceUID.Data    = UIDHelper.GenerateUID("1.2.246.352.71.5");
            sel.SeriesInstanceUID.Data = UIDHelper.GenerateUID("1.2.246.352.71.2");

            /*
             * sel.MediaStorageSOPClassUID = new UniqueIdentifier(TagHelper.MEDIA_STORAGE_SOPCLASS_UID, sel.SOPClassUID.Data);
             * sel.MediaStorageSOPInstanceUID = new UniqueIdentifier(TagHelper.MEDIA_STORAGE_SOPINSTANCE_UID, sel.SOPInstanceUID.Data);
             * sel.ImplementationClassUID = new UniqueIdentifier(TagHelper.IMPLEMENTATION_CLASS_UID, UIDHelper.GenerateUID());
             */
            sel.ApprovalStatus.Data = "REJECTED";
            sel.RTPlanLabel.Data    = "EQD2_" + sel.RTPlanLabel.Data.Trim();
            if (sel.RTPlanLabel.Data.Length > 13)
            {
                sel.RTPlanLabel.Data = sel.RTPlanLabel.Data.Substring(0, 13).Trim();
            }
            plan = sel.ToDICOMObject();

            /*
             * plan.FindFirst(TagHelper.SOPINSTANCE_UID).DData = UIDHelper.GenerateUID();
             * plan.FindFirst(TagHelper.SERIES_INSTANCE_UID).DData = UIDHelper.GenerateUID();
             * plan.FindFirst(TagHelper.RTPLAN_LABEL).DData = "EQD2_" + plan.FindFirst(TagHelper.RTPLAN_LABEL).DData;
             * plan.FindFirst(TagHelper.APPROVAL_STATUS).DData = "REJECTED";
             * this.planUID = plan.FindFirst(TagHelper.SOPINSTANCE_UID).DData.ToString();
             * return plan.FindFirst(TagHelper.SOPINSTANCE_UID).DData.ToString();
             */
            this.planUID = sel.SOPInstanceUID.Data;

            // add metadata
            plan = AddMetaData(plan);
            //return this.planUID;
        }
コード例 #23
0
ファイル: DICOMhandler.cs プロジェクト: rickardcronholm/EQD
        public void UpdateDose(string path)
        {
            // Compute new dose matrix
            string fileName   = path + this.DoseUID + ".dcm";
            var    DoseValues = computeEQD2(fileName, this.nFractions, this.alphaBeta);

            var sel = new DICOMSelector(dose);

            sel.SOPInstanceUID.Data    = UIDHelper.GenerateUID("1.2.246.352.71.7");
            sel.SeriesInstanceUID.Data = UIDHelper.GenerateUID("1.2.246.352.71.2");

            /*
             * dose.FindFirst(TagHelper.SOPINSTANCE_UID).DData = UIDHelper.GenerateUID();
             * dose.FindFirst(TagHelper.SERIES_INSTANCE_UID).DData = UIDHelper.GenerateUID();
             * this.doseUID = dose.FindFirst(TagHelper.SOPINSTANCE_UID).DData.ToString();
             * return dose.FindFirst(TagHelper.SOPINSTANCE_UID).DData.ToString();
             */
            sel.ReferencedRTPlanSequence_[0].ReferencedSOPInstanceUID.Data = this.planUID;

            // overwrite dose matrix
            var _16b = 1 / Math.Pow(2, 16);

            sel.DoseGridScaling.Data = _16b;
            using (var stream = new MemoryStream())
            {
                var binWriter = new BinaryWriter(stream);
                foreach (var d in DoseValues)
                {
                    int integ = (int)(d / _16b);
                    var bytes = BitConverter.GetBytes(integ);
                    binWriter.Write(integ);
                }
                var ows = new OtherWordString(TagHelper.PIXEL_DATA, stream.ToArray());
                sel.ToDICOMObject().Replace(ows);
            }


            //dose = sel.ToDICOMObject();
            this.doseUID = sel.SOPInstanceUID.Data;

            // add metadata
            dose = AddMetaData(dose);
        }
コード例 #24
0
        private void ajouttag(String nom)
        {
            var dcm = DICOMObject.Read(nom);
            var sel = new DICOMSelector(dcm);

            var refDoseRate = new DecimalString
            {
                Tag  = TagHelper.DoseRateSet,
                Data = 400
            };

            var nbBeams = sel.NumberOfBeams.Data;

            for (int i = 0; i < nbBeams; i++)
            {
                sel.ControlPointSequence_[i].Items[0].Add(refDoseRate);
            }
            Console.WriteLine("- Ajout du tag pour l'AutoBreast");
            dcm.Write(nom);
        }
コード例 #25
0
        protected virtual void UpdateTarget(DICOMSelector verificationSelector, IntegerString channelNumber, IntegerString numberOfControlPoints, DecimalString channelLength, DecimalString channelTotalTime, DecimalString sourceApplicatorLength, DecimalString sourceApplicatorStep, DecimalString finalCumulativeTimeweight, Sequence brachyControlPointSeq, int channelId)
        {
            var channelSeq = verificationSelector.ChannelSequence;

            foreach (var item in channelSeq.Data_)
            {
                var itemSelector = new DICOMSelector(item);
                var cn           = itemSelector.ChannelNumber.Data;
                if (cn != channelId)
                {
                    continue;
                }
                itemSelector.NumberOfControlPoints = numberOfControlPoints;
                //itemSelector.ChannelLength;
                itemSelector.ChannelTotalTime           = channelTotalTime;
                itemSelector.SourceApplicatorLength     = sourceApplicatorLength;
                itemSelector.SourceApplicatorStepSize   = sourceApplicatorStep;
                itemSelector.FinalCumulativeTimeWeight  = finalCumulativeTimeweight;
                itemSelector.BrachyControlPointSequence = brachyControlPointSeq;
            }
        }
コード例 #26
0
        public static void Render(DICOMSelector sel, DRR drr)
        {
            //Field rendering
            var exposure   = sel.ExposureSequence;
            var beamLimits = exposure?.Select(s => s.BeamLimitingDeviceSequence);

            if (beamLimits != null)
            {
                var collAngle  = sel.BeamLimitingDeviceAngle.Data;
                var mmPerPixel = sel.ImagePlanePixelSpacing.Data_;

                var points  = new List <List <Point> >();
                var xLimits = beamLimits.Items.FirstOrDefault(b => b.GetSelector().RTBeamLimitingDeviceType.Data == "X" || b.GetSelector().RTBeamLimitingDeviceType.Data == "ASYMX");
                var yLimits = beamLimits.Items.FirstOrDefault(b => b.GetSelector().RTBeamLimitingDeviceType.Data == "Y" || b.GetSelector().RTBeamLimitingDeviceType.Data == "ASYMY");
                if (xLimits != null && yLimits != null)
                {
                    var xjaws = xLimits.GetSelector().LeafJawPositions.Data_;
                    var yjaws = yLimits.GetSelector().LeafJawPositions.Data_;

                    var x1y1 = new Point(xjaws[0] / mmPerPixel[0], yjaws[0] / mmPerPixel[0]);
                    var x1y2 = new Point(xjaws[0] / mmPerPixel[0], yjaws[1] / mmPerPixel[0]);
                    var x2y2 = new Point(xjaws[1] / mmPerPixel[0], yjaws[1] / mmPerPixel[0]);
                    var x2y1 = new Point(xjaws[1] / mmPerPixel[0], yjaws[0] / mmPerPixel[0]);


                    x1y1 = DRR.Rotate(x1y1, collAngle) + drr.Iso2D;
                    x1y2 = DRR.Rotate(x1y2, collAngle) + drr.Iso2D;
                    x2y2 = DRR.Rotate(x2y2, collAngle) + drr.Iso2D;
                    x2y1 = DRR.Rotate(x2y1, collAngle) + drr.Iso2D;

                    points.Add(new List <Point>()
                    {
                        x1y1, x1y2, x2y2, x2y1
                    });
                }

                //points.Add(field.Points().Select(p => new Point(p.X, p.Y)).ToList());
                drr.Image.DrawContours(points, 0, new Scalar(255, 0, 0));
            }
        }
コード例 #27
0
 public int GetTotalNumberOfChannelsInPlan(DICOMObject plan)
 {
     try
     {
         var patientSelector = new DICOMSelector(plan);
         var channelSeq      = patientSelector.ChannelSequence;
         if (channelSeq != null)
         {
             var numberOfChannels = channelSeq.Items.Count;
             return(numberOfChannels);
         }
         else
         {
             return(0);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
コード例 #28
0
ファイル: CMoveResponse.cs プロジェクト: Baasanjav/Evil-DICOM
 public CMoveResponse(DICOMObject d)
     : base(d)
 {
     var sel = new DICOMSelector(d);
     GroupLength = sel.CommandGroupLength.Data;
     AffectedSOPClassUID = sel.AffectedSOPClassUID.Data;
     CommandField = (ushort) C.C_MOVE_RP;
     MessageIDBeingResponsedTo = sel.MessageIDBeingRespondedTo.Data;
     DataSetType = sel.CommandDataSetType.Data;
     NumberOfFailedOps = sel.NumberOfFailedSuboperations != null
         ? sel.NumberOfFailedSuboperations.Data
         : (ushort) 0;
     NumberOfRemainingOps = sel.NumberOfRemainingSuboperations != null
         ? sel.NumberOfRemainingSuboperations.Data
         : (ushort) 0;
     NumberOfCompletedOps = sel.NumberOfCompletedSuboperations != null
         ? sel.NumberOfCompletedSuboperations.Data
         : (ushort) 0;
     NumberOfWarningOps = sel.NumberOfWarningSuboperations != null
         ? sel.NumberOfWarningSuboperations.Data
         : (ushort) 0;
     Status = sel.Status.Data;
 }
コード例 #29
0
        private void vidangeligne(String nom)
        {
            var dcm = DICOMObject.Read(nom);
            var sel = new DICOMSelector(dcm);

            try
            {
                var Vertical     = sel.TableTopVerticalPosition_;
                var Longitudinal = sel.TableTopLongitudinalPosition_;
                var Lateral      = sel.TableTopLateralPosition_;

                for (int i = 0; i < Vertical.Count; i++)
                {
                    sel.TableTopVerticalPosition_[i].Data_.Clear();
                }

                for (int j = 0; j < Longitudinal.Count; j++)
                {
                    sel.TableTopLongitudinalPosition_[j].Data_.Clear();
                }

                for (int k = 0; k < Lateral.Count; k++)
                {
                    sel.TableTopLateralPosition_[k].Data_.Clear();
                }
                Console.WriteLine("- Les lignes 'Table TopVertical Position', 'Table Top Longitudinal Position' et 'TableTopLateralPosition' sont vide.");
            }
            catch (NullReferenceException)
            {
                MessageBox.Show("Impossible de vider les lignes pour le fichier " + nom, "Erreur", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                status.ForeColor = System.Drawing.Color.Red;
                status.Text      = "Modification interrompu ";
                test             = false;
            }
            dcm.Write(nom);
        }
コード例 #30
0
        public CMoveResponse(DICOMObject d)
            : base(d)
        {
            var sel = new DICOMSelector(d);

            GroupLength               = sel.CommandGroupLength.Data;
            AffectedSOPClassUID       = sel.AffectedSOPClassUID.Data;
            CommandField              = (ushort)C.C_MOVE_RP;
            MessageIDBeingRespondedTo = sel.MessageIDBeingRespondedTo.Data;
            DataSetType               = sel.CommandDataSetType.Data;
            NumberOfFailedOps         = sel.NumberOfFailedSuboperations != null
                ? sel.NumberOfFailedSuboperations.Data
                : (ushort)0;
            NumberOfRemainingOps = sel.NumberOfRemainingSuboperations != null
                ? sel.NumberOfRemainingSuboperations.Data
                : (ushort)0;
            NumberOfCompletedOps = sel.NumberOfCompletedSuboperations != null
                ? sel.NumberOfCompletedSuboperations.Data
                : (ushort)0;
            NumberOfWarningOps = sel.NumberOfWarningSuboperations != null
                ? sel.NumberOfWarningSuboperations.Data
                : (ushort)0;
            Status = sel.Status.Data;
        }
コード例 #31
0
ファイル: MyDicom.cs プロジェクト: crisguycabs/origin
 /// <summary>
 /// Constructor con asignación. Lee la ruta del DICOM, lo lee y decodifica la informacion de pixeles. NO NORMALIZA
 /// </summary>
 /// <param name="ruta">Ruta del DICOM a leer</param>
 public MyDicom(string ruta)
 {
     dcm = DICOMObject.Read(@ruta);
     selector = dcm.GetSelector();
     pixelData = Byte2Pixels16((List<byte>)selector.PixelData.Data_, Convert.ToInt16(selector.Columns.Data), Convert.ToInt16(selector.Rows.Data), Convert.ToInt16(selector.PixelRepresentation.Data), Convert.ToDouble(selector.RescaleSlope.Data), Convert.ToDouble(selector.RescaleIntercept.Data), Convert.ToString(selector.PhotometricInterpretation.Data));
 }
コード例 #32
0
 public AbstractDIMSEIOD(DICOMObject dcm)
 {
     _sel = new DICOMSelector(dcm);
 }
コード例 #33
0
 public AbstractDIMSEIOD()
 {
     _sel = new DICOMSelector(new DICOMObject());
 }
コード例 #34
0
 public AbstractDIMSEIOD()
 {
     _sel = new DICOMSelector(new DICOMObject());
 }
コード例 #35
0
 public AbstractDIMSEIOD(DICOMObject dcm)
 {
     _sel = new DICOMSelector(dcm);
 }