-
Notifications
You must be signed in to change notification settings - Fork 8
Replace MIRTK: Surface creation #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
more readable; now consistent with those used in CemrgCommonUtils::ExtractSurfaceFromSegmentation
|
⚡ Code Analysis Results ⚡ 🔴 Cppcheck found 22 issues! Click here to see details.CemrgApp/CemrgApp/Modules/CemrgAppModule/src/CemrgCommonUtils.cpp Lines 1813 to 1818 in 5b4fb6d
!Line: 1813 - style: Redundant initialization for 'scalars'. The initialized value is overwritten before it is read. [redundantInitialization]CemrgApp/CemrgApp/Modules/CemrgAppModule/src/CemrgCommonUtils.cpp Lines 1806 to 1811 in 5b4fb6d
!Line: 1806 - note: scalars is initializedCemrgApp/CemrgApp/Modules/CemrgAppModule/src/CemrgCommonUtils.cpp Lines 1813 to 1818 in 5b4fb6d
!Line: 1813 - note: scalars is overwrittenCemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresClipperView.h Lines 55 to 60 in 5b4fb6d
!Line: 55 - style: The class 'AtrialFibresClipperView' does not have a constructor although it has private member variables. [noConstructor]CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.h Lines 66 to 71 in 5b4fb6d
!Line: 66 - style: The class 'AtrialFibresView' does not have a constructor although it has private member variables. [noConstructor]CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresClipperView.cpp Lines 451 to 456 in 5b4fb6d
!Line: 451 - style: Redundant initialization for 'radii'. The initialized value is overwritten before it is read. [redundantInitialization]CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresClipperView.cpp Lines 450 to 455 in 5b4fb6d
!Line: 450 - note: radii is initializedCemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresClipperView.cpp Lines 451 to 456 in 5b4fb6d
!Line: 451 - note: radii is overwrittenCemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresLandmarksView.h Lines 53 to 58 in 5b4fb6d
!Line: 53 - style: The class 'AtrialFibresLandmarksView' does not have a constructor although it has private member variables. [noConstructor]CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresLandmarksView.cpp Lines 392 to 397 in 5b4fb6d
!Line: 392 - style: The scope of the variable 'distance' can be reduced. [variableScope]CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresLandmarksView.cpp Lines 248 to 253 in 5b4fb6d
!Line: 248 - style: Unused variable: fileRough [unusedVariable]CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresVisualiseView.h Lines 50 to 55 in 5b4fb6d
!Line: 50 - style: The class 'AtrialFibresVisualiseView' does not have a constructor although it has private member variables. [noConstructor]CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp Lines 1794 to 1799 in 5b4fb6d
!Line: 1794 - style: Condition '!userInputAccepted' is always true [knownConditionTrueFalse]CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp Lines 1792 to 1797 in 5b4fb6d
!Line: 1792 - note: Assignment 'userInputAccepted=false', assigned value is 0CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp Lines 1794 to 1799 in 5b4fb6d
!Line: 1794 - note: Condition '!userInputAccepted' is always trueCemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp Lines 2336 to 2341 in 5b4fb6d
!Line: 2336 - style: Variable 'segImage' is assigned a value that is never used. [unreadVariable]CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp Lines 192 to 197 in 5b4fb6d
!Line: 192 - style: Redundant initialization for 'reply1'. The initialized value is overwritten before it is read. [redundantInitialization]CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp Lines 189 to 194 in 5b4fb6d
!Line: 189 - note: reply1 is initializedCemrgApp/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp Lines 192 to 197 in 5b4fb6d
!Line: 192 - note: reply1 is overwrittenCemrgApp/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp Lines 721 to 726 in 5b4fb6d
!Line: 721 - style: Condition 'dcm_path_fix' is always true [knownConditionTrueFalse]CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp Lines 720 to 725 in 5b4fb6d
!Line: 720 - note: Assignment 'dcm_path_fix=true', assigned value is 1CemrgApp/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp Lines 721 to 726 in 5b4fb6d
!Line: 721 - note: Condition 'dcm_path_fix' is always true |
also moves shared code to top of function to fix compilation error
Decimation creates irregular triangle sizes in the surface mesh, which may become a problem later in the workflow when mapping voxels onto the mesh
Resulting files look nearly identical (as discussed on Slack) so remove unnecessary step that depends on MIRTK tool
08a6726 to
0b85f89
Compare
Also deletes three (now unused) helper functions
Delete superfluous test case (which only differed in the morphOperation from the first test case)
21870a6 to
d2df9c5
Compare
Skip round trip to disk for simplicity and performance.
d2df9c5 to
2d54320
Compare
This reverts commit 2d54320.
|
Reverted this commit after discussing with @OrodRazeghi on Slack. Writing the |
LouiseABowler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR isn't quite ready for a full review as the surface generation parameters still need to be checked, but I have done a preliminary review to get the process started.
Overall, this is looking good 👍 I was able to run the example with no problems on Linux, and the changes to the code are clear.
I did spot one potential issue which @JostMigenda is going to pick up on. If invalid values are supplied for the threshold, smoothing or blur parameters, CemrgApp will crash as there isn't currently a way for it to gracefully exit or return an error message to the user. We've had a couple of messages about this and have identified two options for where to make these checks.
Once that's taken care of and the default parameters are finalised, I'll take another look and finish the review off.
|
It looks like there are some subtle differences between the surfaces generated by MIRTK (on the I’m not sure whether that’s caused (at least in part) by the default parameters used for MIRTK being less well suited for the new implementation; so as discussed during previous meeetings, let’s wait for @alonsoJASL to experiment with that. |
This is step 1 of the larger project to remove the dependency on MIRTK; an alternate implementation of
CemrgCommandLine::ExecuteSurfthat usesCemrgCommonUtils::ExtractSurfaceFromSegmentation()instead of MIRTK’sextract-surfaceandsmooth-surfacebinaries.This is a draft PR right now, because there are a number of to-do items:
close-imagebinary at the startmitk::Image/mitk::Surfacedirectly, instead of writing them to disk and passing around the file path. Updating the calling code may be more work, but this could reduce overhead quite a bit.