[Dcmlib] Patient Position

Jean-Pierre Roux jpr at creatis.insa-lyon.fr
Fri Sep 2 16:01:49 CEST 2005


Luca Picello wrote:

> Thank you Jean Pierre for your interest.

[...]

> I just flip my datasets with a vtk class.
> but the question is: when do I have to flip/mirror?
> to work with all datasets I should understand how datas are stored in 
> files but
> I cannot understand the usage of gdcm on how to read dicom tags for 
> orientation.
> maybe you can help :-)


Hi, Luca,

During some discussions we had on the ML,  on this subject, somebody 
told us that flipping or mirroring was to be let at the application 
level, not be a part of gdcm.

I added some minor features to vtkGdcmReader, to take this remark into 
account :

Instead of passing the file name, or passing informations  to build up 
tte set of file names, we may now pass a 'CoherentFileList' (built by 
gdcm::SerieHelper);
A lot of (user defined) job is done by the gdcm::SerieHelper() :

   gdcm::SerieHelper *sh = new gdcm::SerieHelper();

// if user wants to sort the images on Dicom elements he knows :
  sh->SetUserLessThanFunction(userSuppliedLessThanFunction);

// if user wants to sort 'reverse order'
  sh->SetSortOrderToReverse();

// if user wants to exclude sone images from the Coherent File List
  sh->AddRestriction(group, elem, value, operator); operator in 
{GDCM_EQUAL, GDCM_LESSOREQUAL, GDCM_ ...}
  sh->AddRestriction(group, ... ); // as many as user wants

  sh->SetDirectory( dirName, true); // true if user wants to parse 
recursively the Directory holding the images

// Suppose there is only *one* Serie UID in the directory :
 gdcm::FileList *l = sh->GetFirstCoherentFileList();  // just iterate if 
the are many.

 sh->OrderFileList(l); // Sort the gdcm::Files now


  vtkGdcmReader *reader = vtkGdcmReader::New();
// Pass the Coherent File List now
  reader->SetCoherentFileList(l);

// if user *knows* the pixels are not in the right order, he supplies 
his own function (example given in vtkgdcmSerieViewer.cxx)
  reader->SetUserFunction (userSuppliedFunction);
  reader->Update();

It's up to you to decide if you want to flip, mirror, topdown, etc the 
images.
You have to check the 'Patient Position' Entry (0018,5100) :

Possible values are :

//  HFS   = Head First-Supine, where increasing (positive axis direction) :
//     X -> to the direction pointed to by the patient's oustretched 
left arm
//     Y -> to the anterior-to-posterior direction in the patient's body
//     Z -> to the feet-to-head direction in the patient's body

//  HFP   = Head First-Prone, where increasing (positive axis direction) :
//     X -> to the direction pointed to by the patient's oustretched 
left arm
//     Y -> to the anterior-to-posterior direction in the patient's body
//     Z -> to the feet-to-head direction in the patient's body

//  FFS  = Feet First-Supine, where increasing (positive axis direction) :
//     X -> to the direction pointed to by the patient's oustretched 
left arm
//     Y -> to the anterior-to-posterion direction in the patient's body
//     Z -> to the feet-to-head direction in the patient's body

//  FFP  = Feet First-Prone, where increasing (positive axis direction) :
//     X -> to the direction pointed to by the patient's oustretched 
left arm
//     Y -> to the posterior-to-anterior direction in the patient's body
//     Z -> to the feet-to-head direction in the patient's body

There some more values, in the DICOM documentation :

// HFDR = Head First-Decubitus Right
// HFDL = Head First-Decubitus Left
// FFDR = Feet First-Decubitus Right
// FFDL = Feet First-Decubitus Left
(Never saw them; probabely used when the guy is too sick, and cannot lie 
on his back :-( )

HTH

JP





> thank you again
>
> Luca




More information about the Dcmlib mailing list