HomePhabricator
Diffusion MITK a569cc5f01e1

T30294 Remove LabelSet class + Reworked Surface interpolation

Description

T30294 Remove LabelSet class + Reworked Surface interpolation

Summary:
BREAKING: Removed class LabelSet Why: Introduced to much complexity for features that are not needed anymore or could be covered with stl concepts How to adapt: All needed functions have been moved to the LabelSetImage class. Check LabelSetImage......class interface, if use used a LabelSet method in the past (e.g. GetLabel(...), GetLookupTable() or GetActiveLabel()).

  • removed LabelSet class
  • adapted LabelSetImage class

BREAKING: Const version of GetLabelsInGroup renamed to GetConstLabelsInGroup

Why: In some cases one wants to explicitly have the const vector returned,
even if you LabelSetImage is a none const instance. With overload this was
not possible.
How to adapt: Use the new name.

BREAKING: AddLabelSetLayer is replaced by ReplaceGroupLabels and RemoveLayer by RemoveGroup

Why: AddLabelSetToLayer was to complicated due to unecessary features. The part that is not
provided by other methods is now provided by ReplaceGroupLabels.

How to adapt:
(1) Use ReplaceGroupLabels if you want to exchange labels. To generate new layers use AddLayer.
(2) Use RemoveGroup instead of RemoveLayer.

added additional percondition check

  • Migrated MultiLabelIOHelper to LabelSet removal - Fixed error in label preset saving.

Fixed error in ReplaceGroupLabels (image content was deleted) and updated docs.

Refactored for removed LabelSet

BREAKING: Refactored LabelSetImage::CreateLabelMask

Why: remove variables useActiveLayer and layer. They are implicitly defined
by index now.
Internally reworked function to simplify code and use multi threading.
How to adapt: Remove the layer variables. The are not needed anymore. If you
used useActiveLayer = false with layers that didn't contain the specified
label (leads to an empty image) this has to be done now by own code
(by checking if the label exists in the specified group).

  • added GetGroupImage (simelare to GetLayerImage but works correctly also if you request the active layer; will replace it in the future) - Removed obsolete deprecated GetActiveLabel implementation - Removed internal redundant code

Refactored classes to work without removed LabelSet

+ added function for changing lock state and visibility + harmonized querying and handling of label vectors + introduced helper functions for lambda application/visiting

BREAKING!!! What: Remove obsolete widget classes QmitkLabelsWidget, QmitkLabelSetWidget and QmitkLayersWidget How to adapt: Use new widgets QmitkMultiLabelManager or QmitkMultiLabelInspector.

Remove obsolete test

Improve constness of message macro

Refactored tests for new class interface

added missing functions to LabelSetImage

Refactored segmentation tools to new LabelSetImage interface

Refactored interpolation classes to new LabelSetImage interface.

TODO implementation has to be tested and verified

Refactored classes to new LabelSetImage interface

Refactored QmitkMultiLabelTreeModel to new LabelSetImage interface

Refactored QmitkSimpleLabelSetListWidget to new LabelSetImage interface

Refactored segmentation plugin classes to new LabelSetImage interface

Refactored SegmentationUI classes to new LabelSetImage interface

Fixed MultiLabel and SegmentationUI tests

+ changed SurfaceInterpolationController::m_SelectedSegmentation to a weakpointer + removed unused members

BREAKING: LabelSetImage::AddLayer() does not call LabelSetImage::SetActiveLayer(newLayerID) any more. Why: 1) There where reasons where this is unwanted behavior. 2) It is not the job of AddLayer(), change maximizes cohision. 3)...

...ActiveLayer/ActiveLabel are deprecated; thus it makes no sense to add code complexity for them. How to adapt: If you need to change the active layer, call SetActiveLayer explicitly after calling AddLayer. User the return value of AddLayer.

First Fixed for SurfaceInterpolationController Test.

+ changed SliceBasedInterpolationController to explicitly pass parameter
to GetNumberOfLabels();

Added mutex to guard interactions with the CPI map

Changed SurfaceInterpolationController to listen for every RemoveLabel in every session

BREAKING: Removed unused method overload SurfaceInterpoationController::AddNewContour

Reworked SurfaceInterpolationController

  • removed obsolute code
  • fixed node handeling
  • fixed cpi plane identification
  • fixed test

Refactored QmitkSliceInterpolator

  • adapted to changes in SurfaceInterpolationController
  • removed obsolete code

Fixed Undo functionality in conjunction with surface interpolation

Breaking: Removed unused/deprecated SegTool2D::WritePreviewOnWorkingImage

Fixed crash in interpolation when undo seg ops of unselected labels

+ refactored/decoupled whole interpolation pipeline to

not use single filters of controller. Now it can be used concurrent

+ removed obsolete members QmitkSlicesInterpolator and SurfaceInterpolationController

Introduced caching for interpolation results to avoid unecessary recomuptation

Removed dead/obsolete code

BREAKING: Renamed const variable LabelSetImage::UnlabeledValue into LabelSetImage::UNLABELED_VALUE

Corrected mutex (+removed from private function to avoid deadlocks)

Removed obsolete member function UpdateCenterOfMass(PixelType pixelValue, unsigned int layer)

Added ITKEventObserverGuard and test

Add MultiLabel events

BREAKING: Switch LabelSetImage to itk events. Why: mitk messages did not allow 1-to-n settings, as the sender of message is not clear. What: changed to use dedicated itk events. How to adapt: see information in mitkMultiLabelEvents.h and as an...

...example see e.g. QmitkSimpleLabelListWidget.h

Removed unncessary includes.

BREAKING: Removed LabelSetImage::GetLayerImage

Why: Obsolete and missleading because returns invalid information if
one queries for the active layer.

How to adapt: use GetGroupImage as a drop in replacement which works correctly.

+ Added documentation for LabelSetImage + removed obsolete methods

Added tests for LabelSetImage

Merge branch 'develop' into feature/T30294-Remove_LabelSet_class to migrate to Qt6

Merge branch 'develop' into feature/T30294-Remove_LabelSet_class

Test Plan: code review, manual ui testing of segmentation tools and interpolation

Reviewers: O1 MITK Reviewer Group I, O3 MITK Reviewer Group II, kislinsk

Reviewed By: O1 MITK Reviewer Group I, O3 MITK Reviewer Group II, kislinsk

Subscribers: s434n, kislinsk

Differential Revision: https://phabricator.mitk.org/D900

Details

Provenance
flocaAuthored on Mar 8 2024, 4:37 PM
flocaPushed on Mar 11 2024, 10:44 AM
Reviewer
O1: MITK Reviewer Group I
Differential Revision
Restricted Differential Revision
Parents
rMITK5a5fd4e7f607: + Fixed crash when labels are removed while 3D interpolation is active
rMITK3239b8741614: T30366 - added perfusion cmd apps to release config
Branches
Unknown
Tags
Unknown

Merged Changes

This commit merges a very large number of changes. Only the first 50 are shown.