[Insight-users] Read Wrong Values from Image

Martin Waitzbauer mazzok at gmx.at
Wed Feb 22 06:33:49 EST 2012


Hellom

Im experiencing a strange error in the code

  typedef float                                  PixelType;
  typedef itk::Image< PixelType, Dimension >     ImageType;
  typedef itk::ImageFileReader< ImageType >            FixedImageReaderType;
   typename FixedImageReaderType::Pointer fixedImageReader
     = FixedImageReaderType::New();
  typename itk::GDCMImageIO::Pointer DCMimageIO;
  DCMimageIO = itk::GDCMImageIO::New(); 

  
  fixedImageReader->SetImageIO(DCMimageIO);
  try
    {
    fixedImageReader->Update();
    }
  catch( itk::ExceptionObject& err )
    { 
    std::cout << "Could not read one of the input images." << std::endl;
    std::cout << err << std::endl;
    exit( EXIT_FAILURE );
    }
   typedef itk::MinimumMaximumImageCalculator<ImageType> MinMaxType;
		  MinMaxType::Pointer minmaxcalc = MinMaxType::New();
		  minmaxcalc->SetImage(fixedImageReader->GetOutput());
		  minmaxcalc->Compute();
		  int min = minmaxcalc->GetMinimum();
		  int max = minmaxcalc->GetMaximum();



The min / Max values give 8833/ 16093  respectively, although opening the input image in ImageJ for example shows values from 290-7750 only

what am i doing wrong here, someboday knows an answer?


Merci!


Regards, M
	  
-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!                                  
Jetzt informieren: http://www.gmx.net/de/go/freephone/


More information about the Insight-users mailing list