[Insight-users] how to read 2D DICOM series to a JPEG2000 3D volume

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Apr 15 05:58:46 EDT 2009


On Tue, Apr 14, 2009 at 5:52 PM, kongdewen1 kong <kongdewen1 at gmail.com> wrote:
> Hi, guys.
>
> I am a new ITK user. when I try to read 2D DICOM series to a JPEG2000 3D
> volume. when I look at the guide book. there are some problems.
>
> 1) in case no optional series identifier, we usally add the following:
>
> if(argc>3)
> {
>  seriesIdentifier=argv[3]
> }
>  (1) what is the definition of argc?
>  (2) generally, how to set the argv[3]?
>
> 2) about this setence.
>     nameGenerator->SetDirectory(argv[1]);
>   when I set the direction, do I just have to write the direction of the
> file that contains the series?
>  it is right if I put the program like this:  agv[1]="F:\\Medical
> imaging\\001\\prone"

You should really consider argv to be a const...

> 3) about the write the volume.
>    will that be OK if I just write like this:
>
>
> typedef itk::ImageFileWriter< ImageType JPEG2000>WriterType;

Could you point us to the page in the ItfSoftwareGuide or the
example/test that show this usage ?

> WriterType::Pointer writer=WriterType::New();
> writer->SetFileName(001(proneprefer));
> writer->SetInput(reader->GetOutput());
> writer->Update;

ITK does not support JPEG2000 volume (interslice redundancy), nor does
it support J2K/JP2. You may be able however to store encapsulated J2K
in DICOM:

  itk::GDCMImageIO::Pointer dicomIO = itk::GDCMImageIO::New();

  WriterType::Pointer writer = WriterType::New();
  writer->SetImageIO(dicomIO);
  writer->SetInput( myimage );

  // Save as JPEG 2000 Lossless
  // Explicitely specify which compression type to use
  dicomIO->SetCompressionType(itk::GDCMImageIO::JPEG2000);
  // Request compression of the ImageIO
  writer->UseCompressionOn();

2cts
-- 
Mathieu


More information about the Insight-users mailing list