예제 #1
0
        public void PrintFromPartsTest()
        {
            try
            {
                DataSet dicom = new DataSet();
                dicom.Read("FilmSession.dcm");
                string      instance = Element.NewUid();
                FilmSession session  = new FilmSession(instance, dicom);

                dicom = new DataSet();
                dicom.Read("FilmBox.dcm");
                dicom[t.ReferencedFilmSessionSequence + t.ReferencedSOPInstanceUID].Value = instance;
                FilmBox filmbox = session.NewFilmBox(Element.NewUid(), dicom);

                dicom = new DataSet();
                dicom.Read("ImageBox.dcm");
                ImageBox imagebox = filmbox.NewImageBox(Element.NewUid(), dicom);

                print(session, new ApplicationEntity("NER_8900", IPAddress.Parse("127.0.0.1"), 2008));
            }
            finally
            {
            }
        }
예제 #2
0
        static FilmSession CreateFourUpFilmSession()
        {
            DataSet     dicom   = null;
            FilmSession session = new FilmSession();

            session[t.NumberofCopies].Value   = "1";
            session[t.PrintPriority].Value    = "MED";
            session[t.MediumType].Value       = "BLUE FILM";
            session[t.FilmDestination].Value  = "BIN_1";
            session[t.FilmSessionLabel].Value = "";

            FilmBox filmbox = session.NewFilmBox();

            filmbox[t.ImageDisplayFormat].Value = @"STANDARD\2,2";
            filmbox[t.FilmOrientation].Value    = "PORTRAIT";
            filmbox[t.FilmSizeID].Value         = "14INX17IN";
            filmbox[t.BorderDensity].Value      = "330";
            filmbox[t.MinDensity].Value         = "23";
            filmbox[t.MaxDensity].Value         = "331";
            filmbox[t.Trim].Value                  = "NO";
            filmbox[t.Illumination].Value          = "2007";
            filmbox[t.ReflectedAmbientLight].Value = "9";

            dicom = new DataSet();
            dicom.Read(Path.Combine(Tools.RootFolder, @"EK\Capture\Dicom\DicomToolkit\Test\Data\DicomDir\THGLUZ5J.dcm"));

            ImageBox imagebox = filmbox.NewImageBox();

            imagebox[t.MagnificationType].Value             = "MAG_UNKNOWN";
            imagebox[t.SmoothingType].Value                 = "0";
            imagebox[t.ImagePosition].Value                 = "1";
            imagebox[t.Polarity].Value                      = "NORMAL";
            imagebox[t.RequestedDecimateCropBehavior].Value = "DECIMATE";

            imagebox[t.BasicGrayscaleImageSequence + t.SamplesperPixel].Value           = dicom[t.SamplesperPixel].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PhotometricInterpretation].Value = dicom[t.PhotometricInterpretation].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.Rows].Value                = dicom[t.Rows].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.Columns].Value             = dicom[t.Columns].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelAspectRatio].Value    = dicom[t.PixelAspectRatio].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.BitsAllocated].Value       = dicom[t.BitsAllocated].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.BitsStored].Value          = dicom[t.BitsStored].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.HighBit].Value             = dicom[t.HighBit].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelRepresentation].Value = dicom[t.PixelRepresentation].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelData].Value           = dicom[t.PixelData].Value;

            dicom = new DataSet();
            dicom.Read(Path.Combine(Tools.RootFolder, @"EK\Capture\Dicom\DicomToolkit\Test\Data\DicomDir\WNGVU1P1.dcm"));

            imagebox = filmbox.NewImageBox();

            Size truesize = new Size(949, 1210);
            Size original = new Size((ushort)dicom[t.Columns].Value, (ushort)dicom[t.Rows].Value);

            imagebox[t.MagnificationType].Value             = "MAG_UNKNOWN";
            imagebox[t.SmoothingType].Value                 = "0";
            imagebox[t.ImagePosition].Value                 = "2";
            imagebox[t.RequestedImageSize].Value            = "159.431997850537";
            imagebox[t.Polarity].Value                      = "NORMAL";
            imagebox[t.RequestedDecimateCropBehavior].Value = "FAIL";

            imagebox[t.BasicGrayscaleImageSequence + t.SamplesperPixel].Value           = dicom[t.SamplesperPixel].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PhotometricInterpretation].Value = dicom[t.PhotometricInterpretation].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.Rows].Value                = (ushort)truesize.Height;
            imagebox[t.BasicGrayscaleImageSequence + t.Columns].Value             = (ushort)truesize.Width;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelAspectRatio].Value    = dicom[t.PixelAspectRatio].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.BitsAllocated].Value       = dicom[t.BitsAllocated].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.BitsStored].Value          = dicom[t.BitsStored].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.HighBit].Value             = dicom[t.HighBit].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelRepresentation].Value = dicom[t.PixelRepresentation].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelData].Value           = CenterCrop((short[])dicom[t.PixelData].Value, new Size((ushort)dicom[t.Columns].Value, (ushort)dicom[t.Rows].Value), truesize);

            dicom = new DataSet();
            dicom.Read(Path.Combine(Tools.RootFolder, @"EK\Capture\Dicom\DicomToolkit\Test\Data\DicomDir\Y2ASNFDS.dcm"));

            imagebox = filmbox.NewImageBox();

            imagebox[t.MagnificationType].Value             = "MAG_UNKNOWN";
            imagebox[t.SmoothingType].Value                 = "0";
            imagebox[t.ImagePosition].Value                 = "3";
            imagebox[t.RequestedImageSize].Value            = "159.431997850537";
            imagebox[t.Polarity].Value                      = "NORMAL";
            imagebox[t.RequestedDecimateCropBehavior].Value = "FAIL";

            imagebox[t.BasicGrayscaleImageSequence + t.SamplesperPixel].Value           = dicom[t.SamplesperPixel].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PhotometricInterpretation].Value = dicom[t.PhotometricInterpretation].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.Rows].Value                = (ushort)truesize.Height;
            imagebox[t.BasicGrayscaleImageSequence + t.Columns].Value             = (ushort)truesize.Width;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelAspectRatio].Value    = dicom[t.PixelAspectRatio].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.BitsAllocated].Value       = dicom[t.BitsAllocated].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.BitsStored].Value          = dicom[t.BitsStored].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.HighBit].Value             = dicom[t.HighBit].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelRepresentation].Value = dicom[t.PixelRepresentation].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelData].Value           = CenterCrop((short[])dicom[t.PixelData].Value, original, truesize);

            dicom = new DataSet();
            dicom.Read(Path.Combine(Tools.RootFolder, @"EK\Capture\Dicom\DicomToolkit\Test\Data\DicomDir\THGLUZ5J.dcm"));

            imagebox = filmbox.NewImageBox();

            imagebox[t.MagnificationType].Value             = "MAG_UNKNOWN";
            imagebox[t.SmoothingType].Value                 = "0";
            imagebox[t.ImagePosition].Value                 = "4";
            imagebox[t.RequestedImageSize].Value            = "159.431997850537";
            imagebox[t.Polarity].Value                      = "NORMAL";
            imagebox[t.RequestedDecimateCropBehavior].Value = "DECIMATE";

            imagebox[t.BasicGrayscaleImageSequence + t.SamplesperPixel].Value           = dicom[t.SamplesperPixel].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PhotometricInterpretation].Value = dicom[t.PhotometricInterpretation].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.Rows].Value                = dicom[t.Columns].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.Columns].Value             = dicom[t.Rows].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelAspectRatio].Value    = dicom[t.PixelAspectRatio].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.BitsAllocated].Value       = dicom[t.BitsAllocated].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.BitsStored].Value          = dicom[t.BitsStored].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.HighBit].Value             = dicom[t.HighBit].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelRepresentation].Value = dicom[t.PixelRepresentation].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelData].Value           = Rotate((short[])dicom[t.PixelData].Value, original);

            return(session);
        }
예제 #3
0
        static void print(string path, ApplicationEntity host)
        {
            DataSet dicom = new DataSet();

            dicom.Read(path);

            FilmSession session = new FilmSession();

            session[t.NumberofCopies].Value  = "1";
            session[t.PrintPriority].Value   = "MED";
            session[t.MediumType].Value      = "BLUE FILM";
            session[t.FilmDestination].Value = "PROCESSOR";

            PresentationLUT plut = session.NewPresentationLUT();

            plut[t.PresentationLUTShape].Value = "IDENTITIY";

            FilmBox filmbox = session.NewFilmBox();

            filmbox[t.ImageDisplayFormat].Value        = @"STANDARD\1,1";
            filmbox[t.AnnotationDisplayFormatID].Value = "COMBINED";
            filmbox[t.FilmOrientation].Value           = "PORTRAIT";
            filmbox[t.FilmSizeID].Value        = "14INX17IN";
            filmbox[t.MagnificationType].Value = "CUBIC";
            filmbox[t.SmoothingType].Value     = "5";
            filmbox[t.BorderDensity].Value     = "BLACK";
            filmbox[t.MinDensity].Value        = "21";
            filmbox[t.MaxDensity].Value        = "360";
            filmbox[t.Trim].Value                  = "NO";
            filmbox[t.Illumination].Value          = "2500";
            filmbox[t.ReflectedAmbientLight].Value = "2";

            Annotation annotation = filmbox.NewAnnotation();

            annotation[t.AnnotationPosition].Value = 0;
            annotation[t.TextString].Value         = "bottom";

            annotation = filmbox.NewAnnotation();
            annotation[t.AnnotationPosition].Value = 1;
            annotation[t.TextString].Value         = "label";

            ImageBox imagebox = filmbox.NewImageBox();

            imagebox[t.MagnificationType].Value             = "CUBIC";
            imagebox[t.SmoothingType].Value                 = "5";
            imagebox[t.ImageBoxPosition].Value              = "1";
            imagebox[t.Polarity].Value                      = "NORMAL";
            imagebox[t.RequestedDecimateCropBehavior].Value = "DECIMATE";

            imagebox[t.BasicGrayscaleImageSequence + t.SamplesperPixel].Value           = dicom[t.SamplesperPixel].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PhotometricInterpretation].Value = dicom[t.PhotometricInterpretation].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.Rows].Value                = dicom[t.Rows].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.Columns].Value             = dicom[t.Columns].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelAspectRatio].Value    = dicom[t.PixelAspectRatio].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.BitsAllocated].Value       = dicom[t.BitsAllocated].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.BitsStored].Value          = dicom[t.BitsStored].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.HighBit].Value             = dicom[t.HighBit].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelRepresentation].Value = dicom[t.PixelRepresentation].Value;
            imagebox[t.BasicGrayscaleImageSequence + t.PixelData].Value           = dicom[t.PixelData].Value;

            imagebox.PresentationLUT = plut;

            print(session, host);
        }