AW: [Insight-users] Read series DICOM files by itkImageSeriesReader

jiang jiang at TI . Uni-Trier . DE
Tue, 2 Sep 2003 15:06:20 +0200


Hi, Bill,
I try to use typedef itk::Image<unsigned short,3> ImageNDType; to replace
typedef itk::Image<unsigned short,5> ImageNDType;
But it still doesn't work.
My DICOM images are MR images. I can read it by example code
\ITK\InsightApplications-1.2.0\QtITK
Since the image file is 134KB big. I don't attach it here. I just copy the
message print out when I read it.

Thank you for your help. I'm looking forward to creating my first 3d image
by ITK!


Chunyan


loading image
C:/jcy/Qt/TestApp/SeeThrough/1/1.3.12.2.1107.5.2.1.5603.2003073109
3845884002004 ... Reference Count: 1
Modified Time: 32
Debug: Off
Observers:
  none
AbortGenerateData: Off
Progress: 0
FileName:
C:/jcy/Qt/TestApp/SeeThrough/1/1.3.12.2.1107.5.2.1.5603.20030731093845
884002004
FilePrefix:
FileType: 2
ByteOrder: 1
IORegion: Dimension: 2
Index: 0 0
Index: 0 0

Number of Components/Pixel: 1
Pixel Type: unsigned short
Component Type: unsigned_short
Dimensions: ( 256 256 )
Spacing: ( 0.820313 0.820313  )
Origin: ( 0 0  )
Done!



-----Ursprüngliche Nachricht-----
Von: Lorensen, William E (Research) [mailto:lorensen at crd . ge . com]
Gesendet: Dienstag, 2. September 2003 14:15
An: 'jiang'
Cc: Qt
Betreff: RE: [Insight-users] Read series DICOM files by
itkImageSeriesReader


Yes. That was just for testing purposes. Your real app will want to produce
a 3D volume. But that does not seem to be your problem. What is the source
of your DICOM images?

Bill

-----Original Message-----
From: jiang [mailto:jiang at TI . Uni-Trier . DE]
Sent: Tuesday, September 02, 2003 7:37 AM
To: Lorensen, William E (Research)
Cc: Qt
Subject: AW: [Insight-users] Read series DICOM files by
itkImageSeriesReader


No. I don't want to define 5d data. It is copied from
\Insight\Testing\Code\IO\itkDICOMImageSeriesTest.cxx

-----Ursprungliche Nachricht-----
Von: insight-users-admin at itk . org [mailto:insight-users-admin at itk . org]Im
Auftrag von Lorensen, William E (Research)
Gesendet: Dienstag, 2. September 2003 13:11
An: 'jiang'; ITK
Betreff: RE: [Insight-users] Read series DICOM files by
itkImageSeriesReader


You have declared the image to be 5 dimensional, not 3d. Is this what you
intended?

Bill

-----Original Message-----
From: jiang [mailto:jiang at TI . Uni-Trier . DE]
Sent: Thursday, August 28, 2003 10:35 AM
To: ITK
Subject: [Insight-users] Read series DICOM files by itkImageSeriesReader


Hello all,
I want to build 3d image volume by a serie of DICOM files. So I write the
following code according to the example
\Insight\Testing\Code\IO\itkDICOMImageSeriesTest.cxx

#include "itkDICOMImageIO2Factory.h"
#include "itkDICOMImageIO2.h"
#include "itkImageSeriesReader.h"
#include "itkDICOMSeriesFileNames.h"
#include "../Testing/Code/BasicFilters/itkFilterWatcher.h"

int main(int argc, char **argv)
{

  typedef itk::Image<unsigned short,5> ImageNDType;
  typedef itk::ImageSeriesReader<ImageNDType> ReaderType;
  ReaderType::Pointer reader = ReaderType::New();

 itk::DICOMImageIO2::Pointer io = itk::DICOMImageIO2::New();

  // Get the DICOM filenames from the directory
  itk::DICOMSeriesFileNames::Pointer names =
itk::DICOMSeriesFileNames::New();
  names->SetDirectory(s);//s is the directory path

  reader->SetFileNames(names->GetFileNames());
  reader->SetImageIO(io);
  std::cout << names;

  try
    {
    if (atoi(argv[2]))
      {
      reader->ReverseOrderOn();
      }
    reader->Update();
    reader->GetOutput()->Print(std::cout);
    }
  catch (itk::ExceptionObject &ex)
    {
    std::cout << ex;
    return EXIT_FAILURE;
    }


	return EXIT_SUCCESS;
}


However this code can not work. I debug it and find that most codes are
correct. But the program stops at reader->Update();
What is the problem? How can I realize the series DICOM files reading?
I use the latest ITK tarball.



Thanks!


Chunyan

_______________________________________________
Insight-users mailing list
Insight-users at itk . org
http://www . itk . org/mailman/listinfo/insight-users
_______________________________________________
Insight-users mailing list
Insight-users at itk . org
http://www . itk . org/mailman/listinfo/insight-users