VectorRescaleIntensityImageFilter cannot convert from double to short int
Mantis Issue 144, reported by cmoisy, assigned to echristophe, created: 2010-01-19
Location: "void itk::MultiThreader::SingleMethodExecute()" File: /opt/OTB/OrfeoToolbox-3.0/Utilities/ITK/Code/Common/itkMultiThreader.cxx Line: 475 Description: itk::ERROR: MultiThreader(0x1902510): Exception occurred during SingleMethodExecute /usr/local/include/otb/BasicFilters/otbVectorRescaleIntensityImageFilter.h:155: itk::ERROR: Pixel size different from scale or shift size !
I need to convert from double format to short int in order to be able to generate a quicklook image in PNG format
1263917158 - chmoisyI think there is an inconsistency between documentation, examples and methods :
documentation (p224) : is for an otb image <char,2> intensityRescaler->SetInput( difference->GetOutput() ); intensityRescaler->SetOutputMinimum( 0 ); intensityRescaler->SetOutputMaximum( 255 ); => values
example : FeatureExtraction / Extract Roads example : OutputVectorImageType::PixelType minimum,maximum; minimum.SetSize(multispectralReader->GetOutput()->GetNumberOfComponentsPerPixel()); maximum.SetSize(multispectralReader->GetOutput()->GetNumberOfComponentsPerPixel()); minimum.Fill(0); maximum.Fill(255);
1263919734 - chmoisyfollowing the example program, the program is now working : I need to launch UpdateOutPutInformation method before retrieving the number of components per Pixel
1263973335 - christopAdditional comments are added to help understand what is happening: http://hg.orfeo-toolbox.org/OTB/rev/4399242af9d1