[Insight-users] PixelType Doubt
Luis Ibanez
luis.ibanez at kitware.com
Sun Sep 12 13:10:29 EDT 2010
Hi Daniela,
In genera you should use:
A) signed short int for CT
B) float for PET
C) signed shoft int for MRI
I'm not sure about US, but I would expect
that "unsigned char" will be a good fit.
Please take a look at the Insight Journal paper:
http://www.insight-journal.org/browse/publication/146
and the code in:
InsightApplications/Auxiliary/vtk
vtkKWImageIO.cxx
You will see how you can query the actual
pixel type of a DICOM file, and then instantiate
the appropriate pixel type for it.
Look at the "ReadAndCast()" method in lines 465-558:
imageIO->SetFileName( this->FileName.c_str() );
imageIO->ReadImageInformation();
ScalarPixelType pixelType = imageIO->GetComponentType();
// Use the pixel type to instantiate the appropriate reader
switch( pixelType )
{
case itk::ImageIOBase::UCHAR:
{
this->ImageThatHasBeenRead = ReadAndCastMacro( unsigned char );
this->ImagePixelType = UNSIGNED_CHAR;
break;
}
...etc.
Regards
Luis
---------------------------------------------------
On Thu, Sep 9, 2010 at 3:26 AM, Daniela Sacchetto
<danysunflower at hotmail.it>wrote:
> Hi everyone,
> I'm writing because I have a question for you.
> Could anyone explain me how can I decide the itk::PixelType? Usually I work
> with unsigned short pixels, but now I would like to understand better this
> problem.
>
> For ex I know that:
>
> PixelType must be "signed" for CT since Hounsfield units can be < 0.
>
> Are there any rules for each medical image? (TC,PET,US,RX,...)
> And when do you use pixelType = unsigned char?
>
> Thanks all for your help,
> Regards
> Daniela
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100912/748feb38/attachment.htm>
More information about the Insight-users
mailing list