<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Thanks a lot, your mail was very useful for me.<BR>
<BR>
Regards,<BR>
Daniela<BR> <BR>
<HR id=stopSpelling>
Date: Sun, 12 Sep 2010 13:10:29 -0400<BR>Subject: Re: [Insight-users] PixelType Doubt<BR>From: luis.ibanez@kitware.com<BR>To: danysunflower@hotmail.it<BR>CC: insight-users@itk.org<BR><BR><BR>Hi Daniela,<BR><BR><BR>In genera you should use:<BR><BR><BR> A) signed short int for CT<BR> B) float for PET<BR> C) signed shoft int for MRI<BR><BR>I'm not sure about US, but I would expect<BR>that "unsigned char" will be a good fit.<BR><BR><BR><BR>Please take a look at the Insight Journal paper:<BR><BR><A href="http://www.insight-journal.org/browse/publication/146" target=_blank>http://www.insight-journal.org/browse/publication/146</A><BR><BR><BR><BR>and the code in:<BR><BR> InsightApplications/Auxiliary/vtk<BR> vtkKWImageIO.cxx<BR><BR><BR><BR>You will see how you can query the actual<BR>pixel type of a DICOM file, and then instantiate<BR>the appropriate pixel type for it.<BR><BR>Look at the "ReadAndCast()" method in lines 465-558:<BR><BR><BR><BR> imageIO->SetFileName( this->FileName.c_str() );<BR> imageIO->ReadImageInformation();<BR><BR> ScalarPixelType pixelType = imageIO->GetComponentType();<BR><BR> // Use the pixel type to instantiate the appropriate reader<BR> switch( pixelType )<BR> {<BR> case itk::ImageIOBase::UCHAR:<BR> {<BR> this->ImageThatHasBeenRead = ReadAndCastMacro( unsigned char ); <BR> this->ImagePixelType = UNSIGNED_CHAR;<BR> break;<BR> }<BR><BR>...etc.<BR><BR><BR><BR> Regards<BR><BR><BR> Luis<BR><BR><BR><BR>---------------------------------------------------<BR>
<DIV class=ecxgmail_quote>On Thu, Sep 9, 2010 at 3:26 AM, Daniela Sacchetto <SPAN dir=ltr><<A href="mailto:danysunflower@hotmail.it">danysunflower@hotmail.it</A>></SPAN> wrote:<BR>
<BLOCKQUOTE style="PADDING-LEFT: 1ex" class=ecxgmail_quote>
<DIV>Hi everyone,<BR>I'm writing because I have a question for you.<BR>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.<BR> <BR>For ex I know that:<BR> <BR>PixelType must be "signed" for CT since Hounsfield units can be < 0.<BR> <BR>Are there any rules for each medical image? (TC,PET,US,RX,...)<BR>And when do you use pixelType = unsigned char?<BR> <BR>Thanks all for your help,<BR>Regards<BR>Daniela<BR></DIV><BR>_____________________________________<BR>Powered by <A href="http://www.kitware.com/" target=_blank>www.kitware.com</A><BR><BR>Visit other Kitware open-source projects at<BR><A href="http://www.kitware.com/opensource/opensource.html" target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR><BR>Kitware offers ITK Training Courses, for more information visit:<BR><A href="http://www.kitware.com/products/protraining.html" target=_blank>http://www.kitware.com/products/protraining.html</A><BR><BR>Please keep messages on-topic and check the ITK FAQ at:<BR><A href="http://www.itk.org/Wiki/ITK_FAQ" target=_blank>http://www.itk.org/Wiki/ITK_FAQ</A><BR><BR>Follow this link to subscribe/unsubscribe:<BR><A href="http://www.itk.org/mailman/listinfo/insight-users" target=_blank>http://www.itk.org/mailman/listinfo/insight-users</A><BR><BR></BLOCKQUOTE></DIV><BR>                                            </body>
</html>