[Insight-users] Re: R: Changing header dicom!

Luis Ibanez luis.ibanez at kitware.com
Wed Jul 5 09:09:07 EDT 2006


Hi Riccio,

ITK will register images even if they have different
origin (DICOM location)

You shouldn't edit the DICOM header in order to register
two images. Instead what you need is to initialize the
transform in order to account for the difference between
the origins (location) of both images.


You will find examples on how to initialize a transform in
the Image Registration chapter of the ITK S/software Guide;


       http://www.itk.org/ItkSoftwareGuide.pdf


Make sure that the Dimension that you use for instantiating
the ITK images matches the one of the images that you are
reading.

 From your email it wasn't clear whether you were registering
2D images or 3D images.  If you are reading a DICOM volume
you probably should be reading the set of 2D slices with the
ImageSeriesReader in order to construct a 3D image in memory.


You will find instructions on how to read/write DICOM series
in the "Reading and Writing Images" chapter of the ITK software
guide.




    Regards,



       Luis



-------------------------
Riccio Giancarlo wrote:
> Hi Luis,
> I'm sorry but i'm not english and my english is not good.
> 
> The problem is that I must to fuse two images coregistering them with
> “ResampleImageFilter” so as them have the same dimension, but the project in
> which I am working uses only “Dimension = 3”, then, if the two images to
> fuse have differen “Location” the output image is blank, therefore I have
> tried to fuse two images that have same Location (“0,0”) and the fusion have
> worked, however, i've tried to modify the header in my project before to do
> the fusione and the fusion did not work well, in fact controlling the header
> of the output image of ResampleImageFilter filter have noticed that they
> were many differents values, not only the onethat i've modified.
> 
> I wanna know if i do a mistake with this code
> 
> 	DictionaryType & dict1 = itkImage->GetMetaDataDictionary();
> 	itk::EncapsulateMetaData<std::string>( dict1, key, value );
> 	ItkImage->SetMetaDataDictionary(dict1);
> 
> 	// key = "0020|1041" Slice Location
> 	// value = "0.0"	Default Value
> 
> That's all.
> 
> Thanks a lot,
> 
> Riccio Giancarlo, Naples, Italy
> 
>  
> 
> -----Messaggio originale-----
> Da: Luis Ibanez [mailto:luis.ibanez at kitware.com] 
> Inviato: lunedì 3 luglio 2006 23.07
> A: Riccio Giancarlo
> Cc: Insight Users
> Oggetto: Re: Changing header dicom!
> 
> Hi Riccio,
> 
> What is exactly the problem that you are facing?
> 
> According to your email, you changed the DICOM header of an image and after
> saving it in DICOM you find that the new file is different from the original
> file.  Isn't that what you expected ? after all, you just changed the
> header.
> 
> Please be more descriptive with the problem that you are facing.
> 
> A minimal piece of source code that demonstrate the problem will help a lot.
> 
> 
>    Thanks
> 
> 
>       Luis
> 
> 
> 
> -----------------------
> Riccio Giancarlo wrote:
> 
>>Hi Luis,
>> 
>>I'm sorry for the disturb...
>> 
>> i'm trying to change the header dicom of 1 image with this method:
>> 
>>
>>DictionaryType & dict1 = itkImage->GetMetaDataDictionary();
>>
>>itk::EncapsulateMetaData<std::string>( dict1, key, value );
>>
>>ItkImage->SetMetaDataDictionary(dict1);
>>
>>and this method really change the header value, but when i write the 
>>image on disk and compare the headers (using "fc" dos command) the 2 
>>files (original and modified) are not the same (that's ok) because 
>>many header values are modified, not the only value that i've modified.
>>
>>However, if i do this operation with "DicomWorks" i obtain the wished 
>>effect.
>>
>>Thanks  a lot.
>>
>>Riccio Giancarlo
>>
> 
> 
> 
> 
> 




More information about the Insight-users mailing list