[Insight-users] Problem with GetLargestPossibleRegion().GetSize()

Bill Lorensen bill.lorensen at gmail.com
Sat May 22 07:03:56 EDT 2010


Before you ask for the output of the you must:
reader->Update();


On Sat, May 22, 2010 at 6:02 AM, Daniela Sacchetto
<danysunflower at hotmail.it> wrote:
> 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.....
>
>
>
> ________________________________
> Tanti account di posta? Unisci tutto sotto Hotmail
> _____________________________________
> 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
>
>


More information about the Insight-users mailing list