[Insight-users] Segmentation performance Optimization needed

suresh suresh " <suresh_kb@rediffmail.com
13 Nov 2002 13:44:39 -0000


Hi Luis..
Hi Martin..
HI Lydia..


 	Thannks for your help on ResampleImageFilter and Interpolation. 
Yes.. the problem there is with spacing.
 	it was always just 1 for both moving and fixed. I fixed it . Got 
it correct.

 	I need some help about optimizing the perrformance.
 	I'm running this code on a P4 with 256 MB ram.

 	This code is taking nearly 5 minutes to complete.Could please 
suggest any optimizing techniques.

*********************
 	typedef 
itk::NeighborhoodConnectedImageFilter<Converter::ImageType, 
Converter::ImageType> FilterType;

 	FilterType::Pointer filter = FilterType::New();
 	filter->SetInput(image_in);
 	FilterType::IndexType seed;
 	seed[0] = X; seed[1] = Y; seed[2]=slice;
 	filter->SetSeed(seed);

 	//check threshold choices
 	if (lowerThreshold <= 0) return NULL;
 	if (upperThreshold <= 0 || upperThreshold <= lowerThreshold) 
lowerThreshold = 255;

 	filter->SetLower (lowerThreshold);
 	filter->SetUpper (upperThreshold);

 	filter->SetReplaceValue(255);
 	ProgressUpdate(10, "1.2....", (CString)InputVolumeName);
 	try{
 		filter->Update();
 	}catch (itk::ExceptionObject& e){
 		AfxMessageBox(e.GetDescription());
 		return NULL;
 	}
***************************
 	Also the MRIBiasFieldCorrector is consuming lot of time. Any 
optimizing technioque ???

 	Thannks

 	suresh