[Dcmlib] Re: [vtkusers] voxel's volume

Jean-Pierre Roux Jean-Pierre.Roux at creatis.insa-lyon.fr
Tue Apr 4 09:34:33 CEST 2006


Laurent PAUL wrote:

>Mathieu, Jean-Pierre, users,
>
>I understood how to calculate the Zspacing with IOP and IPP.
>But, I need the IPP for two consecutive images. But with the
>'GetValueFromTag' method from GDCMImageIO class, I can only get IPP for
>the first image.
>How to?
>  
>
To be *absolutely* sure the ZSpacing you calculate is the right you, you 
need to be *absolutely* sure that the TWO images you're dealing with 
have the same orientation, and are consecutive.
To know the if the images are consecutive, you *need* to sort the whole 
'serie'.

The method
bool gdcm::SerieHelper::ImagePositionPatientOrdering(FileList *fileSet);
does the job, but I'm not sure vtkgdcmReader takes it into account (I'll 
check and modify the method)

I'm almot sure ITK doesn't.

--> Mathieu ? do you agree?

>Second question, I tried with several volumes with different IOP and IPP.
>I found exactly the same value as in 'Spacing Between Slices' tag.
>Is it just a coincidence?
>  
>
Most of the 'recent' imagers make slices thin enought that they can join 
together (no intergap slice, no slice overlapping).
Within *these* conditions, the stupid way (we have *no* other way) of 
gdcm to return ZSpacing from *one* slice is right.
Probabely, you're a lucky guy, and you work on recent images.

>Third, Is there any example in ITK or Insight Applications which get this
>Zspacing? Is there any method in ITK to do that? I'm not the only one to
>calculate this value?!
>  
>
Maybe all the other ITK users work on 'recent' images, as well?

Jean-Pierre

>Thanks.
>
>Laurnt.
>
>  
>
>>>Laurent,
>>>I do agree with Mathieu.
>>>You cannot get the voxel Z Size reading just an image.
>>>You need 2 images, get the Date Element 0x0020,0x0032 --> Image
>>>      
>>>
>Position
>  
>
>>>(Patient), and compute the Z spacing.
>>>Mathieu :
>>>Don't you think we (I) should add GDCM a method to do that (you pass
>>>      
>>>
>the
>  
>
>>>2 "Image Position (Patient)", and it returns zspacing.
>>>My question : I add it on *which* class (noy on File, not on
>>>      
>>>
>FileHelper,
>  
>
>>>not on Document ...?)
>>>      
>>>
>>This is already in gdcm::SerieHelper::ImagePositionPatientOrdering
>>
>>If you provide anything else people will be tempted to use DICOM files
>>    
>>
>from different series, or do other crazy stuff.
>  
>
>>This operation is really on the edge of gdcm responsability (for a IO
>>    
>>
>toolkit), thus I would not worry about that. I would just make sure that
>vtkGdcmReader is actually using the value from this function rather than
>the -not so usefull- GetZSpacing
>  
>
>>2 cents,
>>Mathieu
>>Ps: See for instance TIFF lib, there is no equivalent so people have
>>    
>>
>themself to do the 3D reconstruction when dealing with TIFFDirectory...
>  
>
>
>
>
>
>  
>




More information about the Dcmlib mailing list