[Insight-users] Losing signal after slice extraction

Huisman, A. A.Huisman-4 at umcutrecht.nl
Mon Jul 31 03:32:54 EDT 2006


Hello Luis,

> This looks like a bug.
> 
> You are right on your assumption that ITK filter must not affect
> their inputs. 
> 
> Could you please add the following statements and post to the
> list the printouts that they produce ?

The MinimumMaximumImageCalculator performed the min-max values computation on the RequestRegion instead of on the LargestPossibleRegion, as I (incorrectly?) assumed. The RequestedRegion was set to be 1 slice after execution of the ExtractImageFilter. I'm not sure if this is a bug or a feature? At least, I solved my problems by calling SetRequestedRegionToLargestPossibleRegion() after using the ExtractImageFilter.
Thanks for your help,
Andre Huisman
 

> --------------------
> Huisman, A. wrote:
>> Hello ITK-users,
>> 
>> I noticed some strange behaviour after application of the
> ITK ExtractImageFilter (Visual Studio 2005, ITK 2.6.0). When
> I read an image and ask for the maximum I get a certain value
> which looks correct. After application of an
> ExtractImageFilter and recomputation of the maximum of the
> original (!) image I get a much lower value. It looks like
> there are some pointers interchanged since the maximum
> calculation on the extracted slide results in the same
> intensity value as computed on the complete image after image
> extraction. However, when I ask for the dimension of the
> original image after slide extraction it still tells me the
> correct number of slides so the pointers are not pointing to
> completely the same image.
>> 
>> Here is the code:
>> 
>> typedef itk::Image<PixelType, 3> InputImageType; typedef
>> itk::Image<PixelType, 2> OutputImageType; typedef
>> itk::ExtractImageFilter<InputImageType, OutputImageType>
>> ExtractImageFilterType; InputImageType::Pointer im =
>> tools->readImageStack(dirPath.c_str(), extension, series_id); //this
>> function reads the complete image stack typedef
>> itk::MinimumMaximumImageCalculator<InputImageType>
>> MinMaxCalculatorType; MinMaxCalculatorType::Pointer minMaxCalc =
>> MinMaxCalculatorType::New(); minMaxCalc->SetImage(im);
>> minMaxCalc->ComputeMaximum();
>> qDebug() << " max after reading: " << minMaxCalc->GetMaximum();
>> 
>> ExtractImageFilterType::Pointer filter =
>> ExtractImageFilterType::New();
>> filter->SetInput(im);
>> 
>> ImageType::RegionType inreg = im->GetLargestPossibleRegion();
>> ImageType::SizeType size2 = inreg.GetSize(); ImageType::IndexType
>> start2 = inreg.GetIndex(); size2[2] = 0; start2[2] = 20; //just as
>> example; I know there are at least 45 slides in this typical image.
>> filter->Update(); MinMaxCalculatorType::Pointer minMaxCalc2 =
>> MinMaxCalculatorType::New();
>> minMaxCalc2->SetImage(im);
>> minMaxCalc2->ComputeMaximum();
>> qDebug() << " max after reading: " << minMaxCalc2->GetMaximum();
>> 
>> Can anyone tell me what I'm doing wrong or what bug is
> causing this behaviour or why this feature works this way (I
> always understood that images are not affected by a filter)?
>> 
>> Thank you very much,
>> André Huisman
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list