[Insight-users] (no subject)
Mathieu Malaterre
mathieu.malaterre at kitware.com
Thu Sep 29 15:02:40 EDT 2005
Wordon,
I had a look at your image, and for some reason it is declared as
Explicit VR - Big Endian (1.2.840.10008.1.2.2) but is indeed Explicit VR
- Little Endian (1.2.840.10008.1.2.1).
Could you tell us where this image is coming from ?
To fix your problem, you could use a program like hexedit on unix and
search for the string '1.2.840.10008.1.2.2' and replace it with
'1.2.840.10008.1.2.1'. Or recompile gdcm after changing the function:
gdcm::Document::SwitchByteSwapCode()
To always have SwapCode = 1234 (on little endian system).
----------------------------------------------------------------
I'll try to find a way in gdcm to make it clearer that reading failed.
So that user could see right away where is the problem. Thanks for the
report and the sample image.
HTH
Mathieu
wordon wrote:
> Hi, Mathieu:
> I use the code to read the file as below.
> But the output file only has header part.
> Can you give me some point?
> The DICOM file as attached file.
> ================================================================
> typedef signed short InputPixelType;
> const unsigned int InputDimension = 3;
> typedef itk::Image< InputPixelType, InputDimension > InputImageType;
> typedef itk::ImageFileReader< InputImageType > ReaderType;
> ReaderType::Pointer reader = ReaderType::New();
> reader->SetFileName( argv[1] );
> typedef itk::GDCMImageIO ImageIOType;
> ImageIOType::Pointer gdcmImageIO = ImageIOType::New();
> reader->SetImageIO( gdcmImageIO );
> reader->Update();
>
> typedef itk::ImageFileWriter< InputImageType > Writer1Type;
> Writer1Type::Pointer writer1 = Writer1Type::New();
> writer1->SetFileName( argv[2] );
> writer1->SetInput( reader->GetOutput() );
> writer1->SetImageIO( gdcmImageIO );
> writer1->Update();
>
> return EXIT_FAILURE;
> }
> ==========================================================
>
> -----Original Message-----
> From: Mathieu Malaterre [mailto:mathieu.malaterre at kitware.com]
> Sent: Thursday, September 29, 2005 10:34 PM
> To: wordon
> Cc: ITK Mailing List
> Subject: Re: [Insight-users] (no subject)
>
> wordon wrote:
>
>>Hi,all :
>>
>>I has a problem about :
>>
>>How to read a DICOM file it has several image in one file?
>
>
> If you refer to multiframe DICOM, then the different slices are actually
> the whole (generally 3D) image. All you need to do is allocate the
> proper image type (Dimension and PixelType). And the reader should do
> the work for you.
>
> HTH
> Mathieu
More information about the Insight-users
mailing list