[Insight-users] Error :itk::MRIBiasFieldCorrectionFilter may be with src code

suresh suresh " <suresh_kb@rediffmail.com
28 Oct 2002 06:26:33 -0000


Hi Luis,

Thanks for the quick response.
But i dont see that the error was due to my Imagetype 's but the 
source code of MRIBiasFieldCorrectionFilter.Let me give the full 
description of my observation.

First: My source code for  your refernce.

 	//
 	//	I have a template class which gives me the ITK image when 
passed a pixel buffer 	//	of any type.
 	//      this template class internally creates a ImageType with 
the pixel type passed
 	typedef BufferToImageConversion<unsigned char> ConverterType;
 	typedef ConverterType::ImageType ImageType;
 	ConverterType converter;
 	ConverterType::ImagePointer imageMRI =  
converter.GetImage(pMRI);

 	typedef itk::MRIBiasFieldCorrectionFilter<ImageType, ImageType, 
ImageType>    		Corrector;
 	Corrector::Pointer filter = Corrector::New() ;

 	filter->SetInput(imageMRI);	// SO THE IMAGE IS OF TYPE UNSIGNED 
CHAR.
 	filter->IsBiasFieldMultiplicative(true) ;
 	filter->SetTissueClassStatistics(classMeans,classSigma) ;
 	filter->SetUsingInterSliceIntensityCorrection(true);
 	filter->SetSlicingDirection(2) ;
 	ProgressUpdate(35, "Apply filter ", MRIVolumeName);
 	filter->Update();
 	ImageType::Pointer imageMRIINHCOR = filter->GetOutput();


Now My observations is...
 	As the compiler points the error as ...
=>       m_EnergyFunction->SetImage(m_InternalInput) ;
=>	itk\Algorithms\itkMRIBiasFieldCorrectionFilter.txx(233)

 	the error could ber with the m_EnergyFunction or 
m_InternalInput.The creation of these two is in the source is 
given as

//	typedef MRIBiasEnergyFunction<TInputImage, ImageMaskType, 
BiasFieldType>
//                                                         
EnergyFunctionType;
//	typedef typename EnergyFunctionType::Pointer            
EnergyFunctionPointer;
//	EnergyFunctionPointer  m_EnergyFunction ;
//	typedef Image< float, itkGetStaticConstMacro(ImageDimension) > 
InternalImageType ;
//	InternalImagePointer m_InternalInput


And i dont see any code related to casting the float image to 
unsigned char image.
Am i missing any thing here??
Do i need to do plug-in any extrac code here??
Please help me..

Thank you for your time and interest,

-suresh