GithubHelp home page GithubHelp logo

kitwaremedical / shaperegressionextension Goto Github PK

View Code? Open in Web Editor NEW
3.0 14.0 7.0 186 KB

Computation and visualization of time-regressed shapes in a collection of 3D shape inputs associated to a linear variable

License: Apache License 2.0

CMake 10.09% Python 89.91%
3d-slicer-extension kitware

shaperegressionextension's Introduction

ShapeRegressionExtension

Description

Computation and visualization of time-regressed shapes in a collection of 3D shape inputs associated to a linear variable thanks to two modules: RegressionComputation and RegressionVisualization.

ShapeRegressionExtension is now available as a 3D Slicer and as a SlicerSALT extension.

Prerequisites

  • RegressionComputation module uses Shape4D CLI to compute time-regressed shapes.
  • RegressionVisualization module uses Sequences module to visualize the time-regressed shapes over time.

shaperegressionextension's People

Contributors

bpaniagua avatar jamesfishbaugh avatar jcfr avatar kwrobot avatar laurapascal avatar phcerdan avatar sjh26 avatar vicory avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shaperegressionextension's Issues

Changes to RegressionVisualization 3D view and volume plot

I would like to request some small changes to the 3D view and volume plot:

  • When the sequence is created and first displayed, center and zoom in on the shape
  • Plot the regression volume as a solid line
  • Change the default location of the legend, top-middle or bottom-middle preferably so as not to obstruct data
  • Optional: Have the legend be draggable to any location in the plot

Comparison tests in RegComputation

@jamesfishbaugh, in the test that compare files, are the comparison files up-to-date with the output of the RegressionComputation module?

The first test runs green, but the comparison fails with all the files except _000.vtk

Is this test passing on your machine? Do you think the test has been exercised often enough with the changes, or we should upload new comparison files?

I have a PR #14, but the comparison test is failing, just want to make sure the failure is not related to the minor changes introduced in the PR.

IO failing in RegressionVisualization

With Qt5

Traceback (most recent call last):
  File "/home/user/Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/ShapeRegressionExtension-build/lib/SlicerSALT-4.9/qt-scripted-modules/RegressionVisualization.py", line 370, in onSequenceCreation
    self.loadModels()
  File "/home/user/Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/ShapeRegressionExtension-build/lib/SlicerSALT-4.9/qt-scripted-modules/RegressionVisualization.py", line 396, in loadModels
    model = MRMLUtility.loadMRMLNode(shapeRootname, inputDirectory, shapeBasename, 'ModelFile')
  File "/home/user/Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/ShapeRegressionExtension-build/lib/SlicerSALT-4.9/qt-scripted-modules/ShapeRegressionUtilities/utility.py", line 16, in loadMRMLNode
    node = slicer.util.getNode(node_name)
  File "/home/user/Software/Shape/SALT/buildRelWithDebInfo/Slicer-build/bin/Python/slicer/util.py", line 656, in getNode
    raise MRMLNodeNotFoundException("could not find nodes in the scene by name or id '%s'" % (pattern if (type(pattern) == str) else ""))
slicer.util.MRMLNodeNotFoundException: could not find nodes in the scene by name or id 'Regression_output_final_time_000'

Warnings

Dumping the warnings for future reference.

Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/tmplandmark.cpp: In copy constructor ‘tmpLandmarks::tmpLandmarks(const tmpLandmarks&)’:
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/tmplandmark.cpp:36:1: warning: base classclass ShapeObject’ should be explicitly initialized in the copy constructor [-Wextra]
 tmpLandmarks::tmpLandmarks(const tmpLandmarks& shape)
 ^~~~~~~~~~~~
[12/33] Building CXX object CMakeFiles/shape4DLib.dir/src/regressionacceleration.cpp.o
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/tmpsurfacecurrent.cpp: In copy constructor ‘tmpSurfaceCurrent::tmpSurfaceCurrent(const tmpSurfaceCurrent&)’:
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/tmpsurfacecurrent.cpp:36:1: warning: base class ‘class ShapeObject’ should be explicitly initialized in the copy constructor [-Wextra]
 tmpSurfaceCurrent::tmpSurfaceCurrent(const tmpSurfaceCurrent& shape)
 ^~~~~~~~~~~~~~~~~
[14/33] Building CXX object CMakeFiles/shape4DLib.dir/src/regressionacceleration.cpp.o
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionvelocity.cpp: In member function ‘virtual Array3D<double> RegressionVelocity::Run()’:
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionvelocity.cpp:257:12: warning: deleting object of abstract class type ‘Optimizer’ which has non-virtual destructor will cause undefined behavior [-Wdelete-non-virtual-dtor]
     delete optimizer;
            ^~~~~~~~~
[26/33] Building CXX object CMakeFiles/shape4DLib.dir/src/regressionacceleration.cpp.o
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/tinyxmlparser.cpp: In static member function ‘static void TiXmlBase::ConvertUTF32ToUTF8(long unsigned int, char*, int*)’:
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/tinyxmlparser.cpp:113:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
    input >>= 6;
    ~~~~~~^~~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/tinyxmlparser.cpp:114:3: note: here
   case 3:
   ^~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/tinyxmlparser.cpp:117:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
    input >>= 6;
    ~~~~~~^~~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/tinyxmlparser.cpp:118:3: note: here
   case 2:
   ^~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/tinyxmlparser.cpp:121:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
    input >>= 6;
    ~~~~~~^~~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/tinyxmlparser.cpp:122:3: note: here
   case 1:
   ^~~~
[28/33] Building CXX object CMakeFiles/shape4DLib.dir/src/polydatareader.cpp.o
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionacceleration.cpp: In member function ‘void RegressionAcceleration::FISTA(Array3D<double>&, Array2D<double>&, Array2D<double>&)’:
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionacceleration.cpp:1175:25: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
         for (; lineIter < maxLineIters; lineIter++)
                ~~~~~~~~~^~~~~~~~~~~~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionacceleration.cpp: In member function ‘void RegressionAcceleration::GradientDescent(Array3D<double>&, Array2D<double>&, Array2D<double>&)’:
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionacceleration.cpp:1528:25: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
         for (; lineIter < maxLineIters; lineIter++)
                ~~~~~~~~~^~~~~~~~~~~~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionacceleration.cpp: In member function ‘void RegressionAcceleration::FISTA(Array3D<double>&, Array2D<double>&, Array2D<double>&)’:
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionacceleration.cpp:1360:50: warning: ‘regularity4’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                         regularityValues[iter+1] = regularity4;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionacceleration.cpp:1359:52: warning: ‘dataMatching4’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                         dataMatchingValues[iter+1] = dataMatching4;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionacceleration.cpp:1340:50: warning: ‘regularity3’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                         regularityValues[iter+1] = regularity3;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionacceleration.cpp:1339:52: warning: ‘dataMatching3’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                         dataMatchingValues[iter+1] = dataMatching3;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionacceleration.cpp:1358:49: warning: ‘functCase4’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                         criterionValues[iter+1] = functCase4;
                         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/regressionacceleration.cpp:1338:49: warning: ‘functCase3’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                         criterionValues[iter+1] = functCase3;
                         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
[30/33] Building CXX object CMakeFiles/shape4DLib.dir/src/main.cpp.o
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/polydatawriter.cpp: In member function ‘bool VTKPolyDataWriter::WritePointsAndTris(const Array2D<double>&, const Array2D<int>&)’:
Software/Shape/SALT/buildRelWithDebInfo/ShapeRegressionExtension-build/shape4D/src/polydatawriter.cpp:133:36: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
         for (unsigned int j = 0; j <field.GetWidth(); j++)

RegressionVisualization 3D rendering issue

When viewing a surface in the 3D scene view at certain angles the shape will be not be rendered properly. Instead, there is a strange transparency and portions of the shape that should be occluded are shown through the surface. I attach a sequence of images to illustrate the issue (3rd image).

shape1
shape2
shape3
shape4

Cmake error during building

I encounter the following error, for various versions of cmake:

...
-- SuperBuild - First pass
-- SuperBuild - First pass - done
-- SuperBuild - shape4D => Requires FFTW, 
-- SuperBuild -   FFTW[OK]
-- SuperBuild - shape4D[OK]
CMake Error at SuperBuild.cmake:85 (ExternalProject_AlwaysConfigure):
  Unknown CMake command "ExternalProject_AlwaysConfigure".
Call Stack (most recent call first):
  CMakeLists.txt:69 (include)

I didn't change anything during configuration, I left everything on default settings.

@phcerdan @jcfr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.