[Insight-users] Medianfilter:Requested region is outside..
Andreas Schuh
andreas.schuh.84 at googlemail.com
Wed Mar 18 05:41:20 EDT 2009
Hi Juliane,
does it make sense that you want to apply the median filter without
considering any neighborhood?
What do you think is the median of just a single value?
That the radius is set to [0, 0, 0] may be your problem.
Try at least [1, 1, 1] instead, which is the default radius used by
itk::MedianImageFilter.
--
regards
Andreas
doege at mi.fu-berlin.de schrieb:
> Hi Luis,
>
> 1. perhaps I was misleading words, I trying to use the itk::median
> filter with mitk and I think that I am getting an itk error, which
> probably means that I am using either itk or mitk wrong.
>
> 2. I am getting the error after using it the first time.
>
> 3.:
> template < typename TPixel, unsigned int VImageDimension >
> void QmitkAutomaticSegmentation::AutomaticSegmentation( itk::Image<
> TPixel, VImageDimension >* itkImage )
> {
> typedef itk::Image< TPixel, VImageDimension > InputImageType; //
> Image type
> typedef itk::Image< TPixel, VImageDimension > OutputImageType;
> typedef typename InputImageType::IndexType IndexType;
>
> //Median Filter
> typedef itk::MedianImageFilter<InputImageType, OutputImageType >
> FilterType; //creating Filtertype
> FilterType::Pointer filter = FilterType::New(); //filter object
> erzeugt filter
>
> InputImageType::SizeType indexRadius; //Radius for calculating the
> median filter
>
> indexRadius[0] = 0; // radius along x
> indexRadius[1] = 0; // radius along y
> indexRadius[2] = 0; // radius along z
> filter->SetRadius( indexRadius );
>
>
> filter->SetInput( itkImage); //aufrufen des Filters
>
> std::cout << "Execute the filter";
> filter->UpdateLargestPossibleRegion();
>
> //filter->Update();
>
>
> mitk::Image::Pointer resultImage = mitk::ImportItkImage(
> filter->GetOutput() );
> mitk::DataTreeNode::Pointer newNode = mitk::DataTreeNode::New();
> newNode->SetData( resultImage );
>
>
> mitk::DataTreeNodeFactory::SetDefaultImageProperties( newNode );
>
>
> // add result to data tree
> mitk::DataStorage::GetInstance()->Add( newNode );
>
> mitk::RenderingManager::GetInstance()->RequestUpdateAll();
> }
>
> Best regards
> Juliane
>
> Quoting Luis Ibanez <luis.ibanez at kitware.com>:
>
>>
>> Hi Juliane,
>>
>>
>> 1) Why are you implementing a median filter ?
>>
>> Is there are reason why the current MedianFilter in ITK
>> is not suitable for what you are doing ?
>>
>>
>> 2) Do you get that error message after running the
>> filter multiple times ?
>>
>> or do you get that error in the first run of the filter ?
>>
>>
>> 3) Can you please post to the list the code of your filter ?
>>
>>
>> Thanks
>>
>>
>> Luis
>>
>>
>>
>> -----------------------------
>> doege at mi.fu-berlin.de wrote:
>>> Hello,
>>>
>>> I am trying to implement a median filter with mitk and getting the
>>> following itk error:
>>> ..\..\..\source\Code\Common\itkDataObject.cxx:
>>> 397:Requested region is (at least partially) outside the largest
>>> possible region.
>>>
>>> I tried to update only the largest possible region but it didn´t
>>> work either. Does anyone got another idea? I also couldn´t find
>>> out how to print out the size of the region.
>>> I am using dicom images with more than 4 slices.
>>>
>>> Best regards
>>> Juliane
>>>
>>> ----------------------------------------------------------------
>>> This message was sent using IMP, the Internet Messaging Program.
>>>
>>> _____________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list