[Insight-users] Problem with GetLargestPossibleRegion().GetSize()
Daniela Sacchetto
danysunflower at hotmail.it
Sat May 22 06:02:33 EDT 2010
Hi
I'm trying to get image size but I always obtain 0x0x0....
The code that I'm using is:
[...]
typedef itk::Image< PixelType, Dimension > ImageType;
typedef ImageType::SizeType SizeType;
typedef itk::ImageFileReader< ImageType > ReaderType;
typedef itk::ImageFileWriter< ImageType > WriterType;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName( argv[1] );
writer->SetFileName( argv[2] );
ImageType::Pointer image = reader->GetOutput();
SizeType imageSize = image->GetLargestPossibleRegion().GetSize();
std::cout << "Image size: " << imageSize[0] << 'x' << imageSize[1] << 'x' << imageSize[2] <<std::endl;
[...]
Giving a 800x500x97 DICOM ultrasound image (RGB) I continue to obtain 0x0x0 on my shell....
Could anyone help me?
Thanks,
Daniela
P.S. My image is a Dicom Image downloaded from ecography....I can't open that with ImageJ because it is a compressed dicom image ... Could it be a problem to use GetLargestPossibleRegion()? I don't believe but I don't understand why my code is wrong.....
_________________________________________________________________
MSN ti offre esattamente quello che cerchi: il tuo browser personale
http://www.pimpit.it/ie8msn/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100522/92290a01/attachment.htm>
More information about the Insight-users
mailing list