Hello!
I am having a very similar issue although I am trying to use a simple
threshold filter. Just to add to the discussion, in my case I added a
new node to the Data Tree using the original image ("pure" MITK, before
calling AccessByItk) and it worked well. The problem only occurs when an
Image imported from ITK is used. In my case, if I remove the line
newNode->SetData( resultImage );
the exception disappears. So I guess it has something to do with the
conversion from ITK to MITK? Something that happens when rendering?
Best regards,
Sam
[email protected] wrote:
> Hello,
>
> I am trying to implement a median filter for dicom pictures. It is
> orientated at the RegionGrowing tutorial, did i forget anything or is
> a DataTreeNode wrong at that point? Why is the region of the image
> wrong?
>
> I am getting the following error messages:
> QRealMutexPrivate::unlock(), error calling ReleaseMutex
> Error code 288 - Es wurde versucht, einen Mutex freizugeben,
> der nicht im Besitz des Aufrufers war.
>
> MITK MainApp caught an exception:
> ..\..\..\source\Code\Common\itkDataObject.cxx:
> 397:
> Requested region is (at least partially) outside the largest possible region.
>
>
> My code:
> void QmitkAutomaticSegmentation::StartButtonClicked()
> {
> ...
>
> AccessByItk( image, AutomaticSegmentation );
> ...
> }
>
> 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;
>
> typedef itk::MedianImageFilter<InputImageType, OutputImageType >
> FilterType;
> FilterType::Pointer filter = FilterType::New();
>
> InputImageType::SizeType indexRadius;
> indexRadius[0] = 1; // radius along x
> indexRadius[1] = 1; // radius along y
> indexRadius[2] = 0; // radius along z
> filter->SetRadius( indexRadius );
>
> filter ->GenerateInputRequestedRegion();
> filter->SetInput( itkImage ); //aufrufen des Filters
>
> filter->Update();
> mitk::Image::Pointer resultImage = mitk::ImportItkImage(
> filter->GetOutput() );
>
> mitk::DataTreeNode::Pointer newNode = mitk::DataTreeNode::New();
> newNode->SetData( resultImage );
>
> mitk::DataTreeNodeFactory::SetDefaultImageProperties( newNode );
> mitk::DataStorage::GetInstance()->Add( newNode );
>
> mitk::RenderingManager::GetInstance()->RequestUpdateAll();
> }
>
> Thanks and best regards,
> Juliane
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users
>
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users