[Insight-users] US1d3ITKImgType not found
Dawood Masslawi
masslawi at gmail.com
Sun Jan 2 10:48:02 EST 2011
Dear Ali,
As I see, you haven't constructed the used image types in the templated class"DoTheRealThing()" which should have been done with the proper pixel types anddimensions. Something like,
typedef short PixelType; const unsigned int Dimension = 2;typedef itk::Image<PixelType, Dimension> S1d3ITKImgType;
Hope this helps,Dawood
--- On Sun, 1/2/11, Ali Habib <ali.mahmoud.habib at gmail.com> wrote:
From: Ali Habib <ali.mahmoud.habib at gmail.com>
Subject: US1d3ITKImgType not found
To: insight-users at itk.org, "Dan Mueller" <dan.muel at gmail.com>, "Dawood Masslawi" <masslawi at gmail.com>
Date: Sunday, January 2, 2011, 9:30 AM
Dear All,
I tried the following code but it always give error that
US1d3ITKImgType , S1d3ITKImgType ,.. not defined am I missing something
sorry for this naive question
Best regards
typedef itk::ImageIOBase::IOComponentType ScalarPixelType;
itk::ImageIOBase::Pointer imageIO =
itk::ImageIOFactory::CreateImageIO(
params::filenameIn, itk::ImageIOFactory::ReadMode);
if (!imageIO) {
std::cerr << "Unable to create a valid ImageIO for image " <<
params::filenameIn << ". Exiting." << std::endl;
return -1;
}
// Now that we found the appropriate ImageIO class, ask it to
// read the meta data from the image file.
//
imageIO->SetFileName(params::filenameIn);
imageIO->ReadImageInformation();
const ScalarPixelType pixelType = imageIO->GetComponentType();
if (params::verbose)
std::cout << "Pixel Type is " << imageIO->GetComponentTypeAsString(pixelType)
<< std::endl;
const size_t numDimensions = imageIO->GetNumberOfDimensions();
if (numDimensions != 3) {
std::cerr << "This soft only soports 3D volumes. Exiting"
<< std::endl;
return -1;
}
switch (pixelType) {
case itk::ImageIOBase::UCHAR: DoTheRealThing<UC1d3ITKImgType>(); break; //UC1d3ITKImgType = unsigned char image of 1 channel, 3 dimensions
case itk::ImageIOBase::SHORT: DoTheRealThing<S1d3ITKImgType>(); break; //S1d3 = Short, one chanel, 3dimensions
case itk::ImageIOBase::USHORT: DoTheRealThing<US1d3ITKImgType>(); break;
case itk::ImageIOBase::FLOAT: DoTheRealThing<F1d3ITKImgType>(); break;
default:
std::cerr << "Pixel Type ("
<< imageIO->GetComponentTypeAsString(pixelType)
<< ") not supported. Exiting." << std::endl;
return -1;
}
return 0;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110102/a306859e/attachment.htm>
More information about the Insight-users
mailing list