Page MenuHomePhabricator

Remove dependency of mitk::ExtractDirectedPlaneImageFilter to pic2vtk module
Closed, ResolvedPublic

Description

Module ImageExtraction could be a nice and clean extension of MITK core. BUT it depends on modules pic2vtk.

Only a couple of lines in

mitkExtractDirectedPlaneImageFilter.cpp

use this dependency and could surely be re-written using pure VTK. This should be done to remove dependencies towards legacy modules.

Event Timeline

I could take care of this. The question is whether the mitkExtractDirectedPlaneImageFilter should be used any more because there is a new one which is currently named: mitkExtractDirectedPlaneImageFilterNew.
Perhaps the mitkExtractDirectedPlaneImageFilter can be replaced by that. I will check that.

I mentioned this bug in the MITK meeting today where some concerns occurred over replacing the "old" mitkExtractDirectedPlaneImageFilter by the "new" mitkExtractDirectedPlaneImageFilterNew.

The reason for that is that the mitkExtractDirectedPlaneImageFilter uses the vtkImageReslice to extract an arbitrary oriented plane. The vtkImageReslice is quiet fast and allows to set an interpolation mode for the slice extraction in order to avoid image artefacts.

But the code of the mitkExtractDirectedPlaneImageFilter is just copied from the mitkImageMapperGL2D which is currently restructured by Thomas Kilgus.

I had the impression that the ExtractDirectedPlaneImageFilter is not working very reliably.

On the other hand the new mitkExtractDirectedPlaneImageFilterNew extracts a slice just by using coordinate transformations. There is also an OverwriteDirectedPlaneImageFilter which writes an arbitrary oriented slice back into an image volume in the same way. Because of that it is guaranteed that both the ExtractDirectedPlaneImageFilterNew and the OverwriteDirectedPlaneImageFilter are operating on exactly the same pixels of the considered volume. This is not the case for the "old" Extractor.

The only disadvantage of the mitkExtractDirectedPlaneImageFilterNew is that it currently cannot perform any interpolation of the pixelvalues.

The question now is: Who uses the old ExtractDirectedPlaneImageFilter? Is the interpolation needed? Should the old one be replaced and maybe the new one extented so that interpolation is supported?

I would be grateful for any comments.

(In reply to comment #2)> The question now is: Who uses the old ExtractDirectedPlaneImageFilter? Is the

interpolation needed? Should the old one be replaced and maybe the new one
extented so that interpolation is supported?

I don't use that filter and don't know where exactly it is used. Have you grepped for it?

However I like your intention of deleting old code! Helpful.

The dependency exists because an MITK image is constructed from the pic image. The MITK image could also be generated from the vtkImageData. The important lines are: 370-388. There the MITK image is initialized and i guess this is the only important difference to the old ImageMapperGL2. (If there are any other parts where pic or something is used, I already replaced them in my new mapper).

Do we have any "out of the box" method to generate an MITK image from a vtkImageData? If yes, this will be a very easy fix, once my mapper is in the Master branch.

The initialize function of the mitkImage takes vtkImageData if that is what you meant.
But despite of that: I checked where this old filter is used: The only one who uses it is Diana and she just extracts a standard plane which could also easily be done with the normal mitkExtractImageFilter.

Additionally I found the ExtractDirectedPlaneImageFilter in the PlaneSimulator.cpp and QmitkTwoDPlusTLungSegmentationView.cpp. But in each class the ExtractDirectedPlaneImageFilter is just initialized but never used thereafter.

So I think we should really consider to replace this old filter with the new one and extent the new one if needed. I can write an email concerning this issue tomorrow. If there is someone who really needs the ExtractDirectedPlaneImageFilter he/she can attract attention to him/herself. I will also talk to Diana about this.

Merging "applicazion modules" component with "ExtApp plugins"

Resetting all bugs without active assignee flag to "CONFIRMED". Change status to IN_PROGRESS if you are working on it.

What is the status? Is someone going to fix it?

The line where pic2vtk was used is commented for a few years now, but the include of pic2vtk is still there.
it can definitely be removed now.

New remote branch pushed: bug-8388-RemovePic2VtkDependency

[2bb7bb]: Merge branch 'bug-8388-RemovePic2VtkDependency'

Merged commits:

2014-01-22 14:04:46 Silvio Kolb [4fb9dd]
module dependency was already removed.
deleted commented code that used the removed include file.