[Repository Listing] / [Slicer4] / trunk / Libs
 

Log of /trunk/Libs

Parent Directory Parent Directory View Directory Listing Directory Listing


Sticky Revision:

Revision 26393  Directory Listing
Modified Sun Sep 24 12:04:18 2017 UTC (27 hours, 9 minutes ago) by lassoan
ENH: Added column property editor to tables module

Type and other properties of any existing column and default properties of new columns can be changed using GUI.
This is important for plotting, which requires numeric column types.

Additional improvements:
* changed defaultValue to nullValue to better reflect that the value represents missint/unknown value.
* made reading and conversion of bit and char type columns more robust

Revision 26391  Directory Listing
Modified Fri Sep 22 02:04:53 2017 UTC (3 days, 13 hours ago) by lassoan
BUG: Fixed build error on Qt4

Revision 26390  Directory Listing
Modified Fri Sep 22 02:04:42 2017 UTC (3 days, 13 hours ago) by lassoan
ENH: setting automatically a Plot layout from Table Widget

Revision 26389  Directory Listing
Modified Fri Sep 22 02:04:34 2017 UTC (3 days, 13 hours ago) by lassoan
BUG: PlotViewController was not updating PlotChartNode from SelectionSingleton

Revision 26388  Directory Listing
Modified Fri Sep 22 02:04:22 2017 UTC (3 days, 13 hours ago) by lassoan
STYLE: store only Column names (and not Indexes) in PlotDataNodes

Revision 26387  Directory Listing
Modified Fri Sep 22 02:04:14 2017 UTC (3 days, 13 hours ago) by lassoan
ENH: added ComboBox for xAxis in the PlotViewController

Revision 26386  Directory Listing
Modified Fri Sep 22 02:04:08 2017 UTC (3 days, 13 hours ago) by lassoan
BUG: fixing crush in PlotViewController (if PlotChart is None)

Revision 26385  Directory Listing
Modified Fri Sep 22 02:04:00 2017 UTC (3 days, 13 hours ago) by lassoan
ENH: added recenter action in the PlotViewControllerWidget

Revision 26383  Directory Listing
Modified Thu Sep 21 01:45:02 2017 UTC (4 days, 13 hours ago) by lassoan
BUG: Fixed test error due to changed selection node

Selection node has now a activePlotChartID member.

Revision 26382  Directory Listing
Modified Wed Sep 20 21:40:20 2017 UTC (4 days, 17 hours ago) by lassoan
ENH: Made default table column type configurable

Default table column type is stored in the table schema, in column name <default>.
There is no GUI yet to change the default column type in a new table.

Revision 26381  Directory Listing
Modified Wed Sep 20 21:40:17 2017 UTC (4 days, 17 hours ago) by lassoan
COMP: Fixed build errors

vtkNew<> still requires .GetPointer() in VTK7.

Revision 26380  Directory Listing
Modified Wed Sep 20 17:13:25 2017 UTC (4 days, 22 hours ago) by jcfr
ENH: Integrate VTK plotting to support Interactive manipulation

This commit provides Plotting facilities that include a Plot View
that can be packed in the layout, similar to the Slice Views and 3D Views.

The architecture also includes nodes that represent the data to be displayed
in the plot as well as nodes to represent the display properties of the data
and the plot itself.

In Addition, the PlotView is connected with the Table Module and Views allowing
the plotting of arrays with a simple click.

References:
https://www.slicer.org/wiki/Documentation/Nightly/Developers/Plots
https://www.na-mic.org/wiki/Project_Week_25/Interactive_Manipulation_of_Plots_and_Graphs
https://www.slicer.org/wiki/Developer_Meetings/20170425

Reviewed-by: Andras Lasso <lasso@queensu.ca>
Reviewed-by: Andriy Fedorov <fedorov@bwh.harvard.edu>
Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Reviewed-by: Steve Pieper <pieper@bwh.harvard.edu>

From: Davide Punzo <punzodavide@hotmail.it>

Revision 26368  Directory Listing
Modified Sun Sep 10 21:20:37 2017 UTC (2 weeks ago) by lassoan
BUG: Exclude crosshair from 3D field of view computation

Crosshair position was taken into account when computing field of view. This caused views centered on empty area between region of interest and crosshair, when crosshair was far away from the region of interest (position was not initialized, a new dataset was loaded, etc).

Solution: exclude crosshair from field of view computations (similarly to axis box and labels).

Revision 26365  Directory Listing
Modified Fri Sep 8 20:48:19 2017 UTC (2 weeks, 2 days ago) by jcfr
COMP: MRML: Fix "inconsistent-missing-override" C++11 warnings

Ensure that overridden functions are explicitly validated
when compiling with C++11

This patch suppresses 100's of warnings:
warning: 'SomeMemberFunctionOfDerivedClass' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 26364  Directory Listing
Modified Fri Sep 8 20:48:12 2017 UTC (2 weeks, 2 days ago) by jcfr
COMP: vtkITK: Add ITK_OVERRIDE for ThreadedExecution

This commit fixes the following warning:

Slicer/Libs/vtkITK/itkMorphologicalContourInterpolator.hxx:93:3: warning: 'ThreadedExecution' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  ThreadedExecution( const DomainType& subDomain, const ThreadIdType threadId )

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 26363  Directory Listing
Modified Fri Sep 8 20:43:50 2017 UTC (2 weeks, 2 days ago) by jcfr
COMP: vtkOrientedBSplineTransform: Remove duplicate GetDisplacementScale

This commit fixes the following warning:

Slicer/Libs/vtkAddon/vtkOrientedBSplineTransform.h:64:3: warning: 'GetDisplacementScale' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  vtkGetMacro(DisplacementScale,double);
  ^

The function GetDsplacementScale is defined as a public member
function of the base class, and should not be overridden
in the child class.

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 26362  Directory Listing
Modified Fri Sep 8 20:40:41 2017 UTC (2 weeks, 2 days ago) by jcfr
BUG: SegmentationDisplayNode: Equality instead of Assignment

Slicer/Libs/MRML/Core/vtkMRMLSegmentationDisplayNode.cxx:938:17: warning: equality comparison result unused [-Wunused-comparison]
    colorNumber == this->NumberOfGeneratedColors;
    ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Slicer/Libs/MRML/Core/vtkMRMLSegmentationDisplayNode.cxx:938:17: note: use '=' to turn this equality comparison into an assignment
    colorNumber == this->NumberOfGeneratedColors;
                ^~
                =

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 26355  Directory Listing
Modified Wed Sep 6 22:42:04 2017 UTC (2 weeks, 4 days ago) by pinter
ENH: Show generated color in terminology navigator if selected entry contains no recommended color

This is an update to the previous implementation that kept increasing the index of the generated color (from generic anatomy color table). That solution was not ideal, as the generated color was only applied once the terminology entry was selected, which means that when the user clicked on a terminology type with no recommended color set, then they saw the invalid gray in the color box of the terminology navigator, which was changed to the generated color on acceptance. This was confusing.

Now the generated color appears in the terminology navigator widget as well, replacing the invalid gray.
The way the color is generated also changed: now the generated color is always the same as what the empty segment initially had (the index of the segment in the generic anatomy color table plus one so that background is ignored).

Revision 26344  Directory Listing
Modified Tue Sep 5 14:29:50 2017 UTC (2 weeks, 6 days ago) by jcfr
COMP: Fix unused variable warnings

Revision 26323  Directory Listing
Modified Wed Aug 30 19:53:08 2017 UTC (3 weeks, 4 days ago) by pinter
ENH: Added segment name and color auto-generated flag storage support

Now segment properties NameAutoGenerated and ColorAutoGenerated are saved with the scene and loaded as well.

Revision 26322  Directory Listing
Modified Wed Aug 30 18:44:51 2017 UTC (3 weeks, 4 days ago) by pinter
ENH: Added convenience function in vtkSegmentation to get segment by name

A few stylistic changes were done as well: typos, copy-paste mistakes, indentation consistency

Revision 26313  Directory Listing
Modified Mon Aug 28 20:14:31 2017 UTC (3 weeks, 6 days ago) by jcfr
COMP: Fix VTK python wrapping of extension built against Slicer with VTK8

This commit ensures the complete set of include directories is provided
to the vtkWrapHierarchy executable.

This problem was discovered while adding support for Qt5 and VTK8 to
the CarreraSlice extension.

It fixes the following error where vtkTypeMacro was improperly considered
as a function:

```
In file included from /home/jcfr/Projects/Slicer-2-Qt5-VTK8-build/VTKv8/Common/Core/vtkVariant.h:37:0,
                 from /tmp/CarreraSlice-build/src/fastGrowCut/Logic/vtkFastGrowCutPython.cxx:10:
/tmp/CarreraSlice-build/src/fastGrowCut/Logic/vtkFastGrowCutPython.cxx: In function ‘PyObject* PyvtkFastGrowCut_vtkTypeMacro(PyObject*, PyObject*)’:
/home/jcfr/Projects/Slicer-2-Qt5-VTK8-build/VTKv8/Common/Core/vtkSetGet.h:630:3: error: expected unqualified-id before ‘protected’
   protected: \
   ^
/home/jcfr/Projects/Slicer-2-Qt5-VTK8-build/VTKv8/Common/Core/vtkSetGet.h:664:3: note: in expansion of macro ‘vtkAbstractTypeMacroWithNewInstanceType’
   vtkAbstractTypeMacroWithNewInstanceType(thisClass, superclass, thisClass, #thisClass) \
   ^
/home/jcfr/Projects/Slicer-2-Qt5-VTK8-build/VTKv8/Common/Core/vtkSetGet.h:670:3: note: in expansion of macro ‘vtkAbstractTypeMacro’
   vtkAbstractTypeMacro(thisClass, superclass) \
   ^
/tmp/CarreraSlice-build/src/fastGrowCut/Logic/vtkFastGrowCutPython.cxx:45:11: note: in expansion of macro ‘vtkTypeMacro’
       op->vtkTypeMacro(*temp0, *temp1);
           ^
```

Revision 26310  Directory Listing
Modified Mon Aug 28 15:56:38 2017 UTC (3 weeks, 6 days ago) by pinter
BUG: Fix endless loop caused by invalid segment tags string

A binary string was set as a tag value, that contained the separator, thus causing a segment tag to be invalid. The parser entered an endless loop, which is now fixed. The tag, however is not fully recovered.

Related to https://discourse.slicer.org/t/issue-with-vtk-leaks/954/6

Revision 26309  Directory Listing
Modified Sat Aug 26 18:23:10 2017 UTC (4 weeks, 1 day ago) by pinter
ENH: Use generated color if selected terminology entry contains no recommended color

There were two options to do this:
1. Only increase counter when segment is added: change the terminology of not the last segment to one with no recommended color, then the segment's color will be the same as the last one
2. Increase counter on every generation: if the user changes terminology of the same segment multiple times to one with no recommended color, then the generated color will be different each time
-> The second has been implemented, as it seems to cause the smaller problem.

Revision 26287  Directory Listing
Modified Wed Aug 16 19:48:16 2017 UTC (5 weeks, 4 days ago) by jcfr
STYLE: SliceLogic: Simplify code using "std::max"

Suggested-by: Max Smolens <max.smolens@kitware.com>

Revision 26286  Directory Listing
Modified Wed Aug 16 19:40:35 2017 UTC (5 weeks, 4 days ago) by jcfr
STYLE: SliceLogic: Remove unused min/max macros

Suggested-by: Max Smolens <max.smolens@kitware.com>

Revision 26285  Directory Listing
Modified Wed Aug 16 19:34:01 2017 UTC (5 weeks, 4 days ago) by jcfr
BUG: SliceLogic: Fix "Bad plane coordinate system" vtkPlaneSource error

The errors can be reproduced using Slicer built against Qt4/VTK7/OpenGL
or Qt5/VTK8/OpenGL2 by:
(1) switching to "Conventional" (or "Conventional Widescreen") layout
(2) and re-sizing the viewers using the "spacer" until their are hidden.

This commit also fixes qMRMLLayoutManagerWithCustomFactoryTest that was
failing with the same error when built using Qt5/VTK8/OpenGL2.

Error similar to the one copied below:

```
Bad plane coordinate system


Algorithm vtkPlaneSource(0x4e5a020) returned failure for request: vtkInformation (0x4e5ca40)
  Debug: Off
  Modified Time: 978985
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_DATA
  ALGORITHM_AFTER_FORWARD: 1
  FROM_OUTPUT_PORT: 0
  FORWARD_DIRECTION: 0
```

Reviewed-by: Andras Lasso <lasso@queensu.ca>

Revision 26265  Directory Listing
Modified Mon Aug 14 02:16:23 2017 UTC (6 weeks ago) by jcfr
COMP: Fix QStyleOptionFrameV[2-4] deprecation warnings with Qt5

Fix warnings similar to the following when building with Qt5:

    Base/QTGUI/qSlicerStyle.cxx:149:61: warning: 'QStyleOptionFrameV2' is deprecated [-Wdeprecated-declarations]

From: Max Smolens <max.smolens@kitware.com>

Revision 26264  Directory Listing
Modified Mon Aug 14 02:16:20 2017 UTC (6 weeks ago) by jcfr
ENH: Update slice view size when app is moved to a different screen

Update the slice view size when app is moved to a different screen to
account for a possible difference in the device pixel ratio of the old
and new screens.

From: Max Smolens <max.smolens@kitware.com>

Revision 26263  Directory Listing
Modified Mon Aug 14 02:16:17 2017 UTC (6 weeks ago) by jcfr
ENH: Scale slice view size by device pixel ratio

From: Max Smolens <max.smolens@kitware.com>

Revision 26261  Directory Listing
Modified Mon Aug 14 02:16:13 2017 UTC (6 weeks ago) by jcfr
ENH: WIP: Make QtTesting tests compatible with QVTKOpenGLWidget

Make QtTesting tests compatible with QVTKOpenGLWidget. For simplicity
and to maintain backwards compatibility, duplicate the xml logs and
manually replace the widget name.

From: Max Smolens <max.smolens@kitware.com>

Revision 26260  Directory Listing
Modified Mon Aug 14 02:16:07 2017 UTC (6 weeks ago) by jcfr
ENH: Set default QSurfaceFormat for QVTKOpenGLWidget

Set default QSurfaceFormat for QVTKOpenGLWidget so that QVTKOpenGLWidget
receives the proper OpenGL core profile context.

From QOpenGLWidget documentation (http://doc.qt.io/qt-5/qopenglwidget.html):

    Note: Calling QSurfaceFormat::setDefaultFormat() before constructing
    the QApplication instance is mandatory on some platforms (for
    example, macOS) when an OpenGL core profile context is requested.
    This is to ensure that resource sharing between contexts stays
    functional as all internal contexts are created using the correct
    version and profile.

Client code uses QVTKOpenGLWidget when SlICer_VTK_USE_QVTKOPENGLWIDGET
is defined in vtkSlicerConfigure.h.

Multisampling is disabled to support volume rendering and other VTK
functionality that reads from the framebuffer. See
https://gitlab.kitware.com/vtk/vtk/issues/1709.

From: Max Smolens <max.smolens@kitware.com>

Revision 26256  Directory Listing
Modified Mon Aug 14 02:15:33 2017 UTC (6 weeks ago) by jcfr
ENH: Set VTK view to vertically expand

With Qt5 the view controller widgets occupied equal vertical space as
the VTK views. Set size policies so that VTK views expand vertically.

From: Max Smolens <max.smolens@kitware.com>

Revision 26252  Directory Listing
Modified Mon Aug 14 02:15:15 2017 UTC (6 weeks ago) by jcfr
ENH: Suport Qt5 integrating QCleanLooksStyle from qtstyleplugins

This commit integrates qtstyleplugins files based of commit 600c296
from git://code.qt.io/qt/qtstyleplugins.git

BUG: bug fixes for some compilation errors on Windows

Co-authored-by: Hina Shah <hina.shah@kitware.com>

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 26251  Directory Listing
Modified Mon Aug 14 02:07:21 2017 UTC (6 weeks ago) by jcfr
ENH: Add preliminary support for Qt5

Support configuration using either Qt4 or Qt5

Based on preliminary work from Steve Pieper <pieper@bwh.harvard.edu>

* vtkSlicerConfigure: Introduced Slicer_HAVE_QT5 and Slicer_HAVE_WEBKIT_SUPPORT.
  This was needed to workaround limitation of "moc" compiler preventing it
  from expanding macro like "QT_VERSION_CHECK.

* Explicitly set QT_PLUGINS_DIR and QT_BINARY_DIR variables when using Qt5

* Update extension build system to propagate Qt version

Tested with Qt 5.7 and Qt 5.9 on Ubuntu

Remaining tasks:
* Port extension manager
* Update install/packaging rules to support Qt5
* SlicerStyle (based on CommonStyle) is disabled (see Main.cxx). Application crashes on Linux.
* Fix runtime errors:
 * libpng warning: iCCP: known incorrect sRGB profile
 * QPixmap::grabWidget is deprecated, use QWidget::grab() instead

Co-authored-by: Hina Shah <hina.shah@kitware.com>
Co-authored-by: Max Smolens <max.smolens@kitware.com>

COMP adding qt5 variables for extension testing

COMP Adding Qt5 build and plugin cmake variables

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 26249  Directory Listing
Modified Mon Aug 14 02:06:31 2017 UTC (6 weeks ago) by jcfr
COMP: Update usage of method deprecated in VTK8.1

VTK8.1 deprecated vtkWindowToImageFilter::SetMagnification(). Replace
calls to that method with vtkWindowToImageFilter::SetScale().

From: Max Smolens <max.smolens@kitware.com>

Revision 26248  Directory Listing
Modified Mon Aug 14 02:06:21 2017 UTC (6 weeks ago) by jcfr
COMP: Fix inconsistent-missing-override warnings

This commit adds the VTK_OVERRIDE macros to fix the warnings.

From: Hina Shah <hina.shah@kitware.com>

Revision 26247  Directory Listing
Modified Mon Aug 14 02:05:17 2017 UTC (6 weeks ago) by jcfr
ENH: Remove vtkDebugLeaks::DestructClass() call

In VTK8, vtkObjectFactory::CreateInstance() never registers the class name with
vtkDebugLeaks if the factory fails to create the object. Therefore, it's no
longer necessary to unregister the class name with vtkDebugLeaks.

From: Max Smolens <max.smolens@kitware.com>

Revision 26246  Directory Listing
Modified Mon Aug 14 02:05:15 2017 UTC (6 weeks ago) by jcfr
ENH: Call InitializeObjectBase() in New() methods

In VTK8 it's necessary for New() methods to call InitializeObjectBase() on the
new object for proper tracking with vtkDebugLeaks. The standard macros
(vtkStandardNewMacro, vtkObjectFactoryNewMacro) handle this. For those classes
that don't use the macros, add calls to InitializeObjectBase().

Continue to support earlier versions of VTK by wrapping calls to
InitializeObjectBase() in checks for the preprocessor define
VTK_HAS_INITIALIZE_OBJECT_BASE.

It's possible that many of these implementations could be simplified by using
the standard macros.

See also:
- https://github.com/Kitware/VTK/commit/e5c793d
- http://public.kitware.com/pipermail/vtk-developers/2016-September/034332.html

From: Max Smolens <max.smolens@kitware.com>

Revision 26243  Directory Listing
Modified Sun Aug 13 00:10:41 2017 UTC (6 weeks, 1 day ago) by lassoan
BUG: Fixed display of cell attributes

Attribute location was not updated in the MRML node when it was changed in the GUI.
Attribute location (point or cell) was not saved in the scene file.
Attribute scalar range was not computed correctly for cell arrays.

Revision 26215  Directory Listing
Modified Tue Aug 8 03:12:56 2017 UTC (6 weeks, 6 days ago) by jcfr
COMP: vtkArchive: Fix deprecation warnings due to LibArchive update

This commit updates fix "deprecated-declarations" warnings based on
recommendations documented in "libarchive_changes.3".

See https://github.com/libarchive/libarchive/wiki/ManPageLibarchiveChanges3#Deprecated_Symbols

Revision 26214  Directory Listing
Modified Tue Aug 8 03:12:54 2017 UTC (6 weeks, 6 days ago) by jcfr
COMP: vtkITKImageToImageFilter: Fix overloaded-virtual warnings

This commit fixes warning like the following:

```
In file included from /path/to/Slicer-build/VTKv7/Common/ExecutionModel/vtkImageAlgorithm.h:29:0,
                 from /path/to/Slicer/Libs/vtkITK/vtkITKImageToImageFilter.h:26,
                 from /path/to/Slicer-build/Slicer-build/Libs/vtkITK/vtkITKImageToImageFilterPython.cxx:11:
/path/to/Slicer-build/VTKv7/Common/ExecutionModel/vtkAlgorithm.h:489:15: warning: ‘virtual int vtkAlgorithm::Update(vtkInformation*)’ was hidden [-Woverloaded-virtual]
   virtual int Update(vtkInformation* requests);
               ^
In file included from /path/to/Slicer-build/Slicer-build/Libs/vtkITK/vtkITKImageToImageFilterPython.cxx:11:0:
/path/to/Slicer/Libs/vtkITK/vtkITKImageToImageFilter.h:172:16: warning:   by ‘vtkITKImageToImageFilter::Update’ [-Woverloaded-virtual]
   virtual void Update(int port)
                ^
In file included from /path/to/Slicer-build/VTKv7/Common/ExecutionModel/vtkImageAlgorithm.h:29:0,
                 from /path/to/Slicer/Libs/vtkITK/vtkITKImageToImageFilter.h:26,
                 from /path/to/Slicer-build/Slicer-build/Libs/vtkITK/vtkITKImageToImageFilterPython.cxx:11:
/path/to/Slicer-build/VTKv7/Common/ExecutionModel/vtkAlgorithm.h:483:15: warning: ‘virtual int vtkAlgorithm::Update(int, vtkInformationVector*)’ was hidden [-Woverloaded-virtual]
```

Revision 26213  Directory Listing
Modified Tue Aug 8 03:12:52 2017 UTC (6 weeks, 6 days ago) by jcfr
COMP: vtkMRMLFreeSurferModelOverlayStorageNode: Fix unused parameter warning

Revision 26208  Directory Listing
Modified Sat Aug 5 00:09:22 2017 UTC (7 weeks, 2 days ago) by lassoan
BUG: Fixed vtkCodedEntry serialization to string

A separator was missing in the generated string. Regression was introduced yesterday by recent code changes.

Added automatic tests to avoid such regressions in the future.

Revision 26201  Directory Listing
Modified Fri Aug 4 19:15:46 2017 UTC (7 weeks, 2 days ago) by jcfr
COMP: Update CMake minimum required version from 2.8.9 to 3.5

This commit removes few workarounds and explicit setting of CMake policies.

Note that the setting of CMP0017 to OLD (introduced in r16366 (COMP: Update
CMake policy requirements) is not needed. Slicer does not provide CMake
modules that should be included by modules distributed by CMake.

This will ensure the CMake version has:

* support for VS 2015 (introduced in CMake 3.1)

* a decent support for detecting compiler features (useful with C++11 and above)
  See https://cmake.org/cmake/help/v3.5/manual/cmake-compile-features.7.html

* as well as support for modern cmake that will be used to modernize the
  Slicer build system.
  See https://cmake.org/cmake/help/v3.5/manual/cmake-buildsystem.7.html#build-specification-and-usage-requirements

CMake 3.5 is also old enough (release in April 2016) and available (same version
or above) in distributions like these ones:

* Arch Linux
* Ubuntu LTS 14.04, 16.04
* OpenSUSE Leap 42.2, 42.3
* Debian 9, Sid
* Fedora 24/25/26
* Slackware 14.2

See https://pkgs.org/download/cmake

// ------------
Update MultiVolumeExplorer:

$ git shortlog 7e44252..c4d3b65 --no-merges
Andrey Fedorov (1):
      ENH: helper script to get stats for a mv frame

Jean-Christophe Fillion-Robin (1):
      COMP: Update CMake version to 3.5.0

// ------------
Update MultiVolumeImporter:

git shortlog 3fb2858..b2453a8 --no-merges
Jean-Christophe Fillion-Robin (1):
      COMP: Update CMake version to 3.5.0

Revision 26199  Directory Listing
Modified Fri Aug 4 03:35:37 2017 UTC (7 weeks, 3 days ago) by lassoan
ENH: Changed coded entry field order to (value, scheme, meaning)

This (value, scheme, meaning) order is more commonly used in the DICOM standard and DCMTK as the (scheme, value, meaning) order that was used in the original implementation of vtkCodedEntry.

Revision 26190  Directory Listing
Modified Thu Aug 3 04:08:55 2017 UTC (7 weeks, 4 days ago) by jcfr
COMP: Update vtkMRMLSceneTest1 and vtkPVScalarBarActor to support VS2015

Co-authored-by: Max Smolens <max.smolens@kitware.com>

From: Adam Rankin <adam.rankin@gmail.com>

Revision 26187  Directory Listing
Modified Tue Aug 1 20:07:33 2017 UTC (7 weeks, 5 days ago) by pinter
ENH: Use new vtkCodedEntry class as base class for terminology containers

Related to https://github.com/Slicer/Slicer/pull/752

Revision 26186  Directory Listing
Modified Sat Jul 29 13:31:33 2017 UTC (8 weeks, 2 days ago) by lassoan
BUG: Fixed parent transform setting by drag-and-drop

In Data module / Transform hierarchy tab, transform parent can be set by drag-and-drop even if
the transform is being constantly modified (such as in a surgical navigation scenario, when
position tracker device continuously updates the transform through OpenIGTLink).

Fixes https://issues.slicer.org/view.php?id=4138

Revision 26185  Directory Listing
Modified Sat Jul 29 04:39:55 2017 UTC (8 weeks, 2 days ago) by lassoan
ENH: Added saving of DICOM scalar volume voxel quantity&unit in volume node

It implements functionality originally implemented in this commit (but later reverted due to regressions):
"ENH: init quantity/units in scalar volume plugin" (4ac23a026eac73f471c53383c9cd73cf30eabc79).

This commit is functionally equivalent (except CT quantity incorrect code value has been fixed in
mapSOPClassUIDToDICOMQuantityAndUnits).

Quantity and unit of voxel values of scalar volumes can be accessed in vtkMRMLScalarVolumeNode by using these methods:
  void SetVoxelValueQuantity(vtkCodedEntry*);
  vtkGetObjectMacro(VoxelValueQuantity, vtkCodedEntry);
  void SetVoxelValueUnits(vtkCodedEntry*);
  vtkGetObjectMacro(VoxelValueUnits, vtkCodedEntry);

vtkCodedEntry class was added that simplifies storage, printing, serialization of code scheme/value/meaning triplets
so that it can be easily added to other node types in the future.

DICOMScalarVolumePlugin sets these values when the data is loaded from DICOM.

Added test of setting quantity and unit in scalar volume node during DICOM import (py_DICOMReaders test).

Revision 26181  Directory Listing
Modified Fri Jul 28 17:09:20 2017 UTC (8 weeks, 2 days ago) by pinter
STYLE: Typos and more meaningful message

Revision 26178  Directory Listing
Modified Wed Jul 26 19:01:34 2017 UTC (2 months ago) by pinter
BUG: Fixed segmentation to labelmap export with one-slice reference volume

Fixes #4392

Revision 26173  Directory Listing
Modified Tue Jul 25 19:13:02 2017 UTC (2 months ago) by pinter
ENH: Updated fractional labelmap conversion rule costs

They were both still 500ms, probably not changed after creation based on other converters

Revision 26170  Directory Listing
Modified Mon Jul 24 22:27:35 2017 UTC (2 months ago) by pinter
ENH: Exposing output metrics in vtkCalculateOversamplingFactor

Revision 26169  Directory Listing
Modified Mon Jul 24 22:26:51 2017 UTC (2 months ago) by pinter
ENH: Added python compatibility function to get SH items referenced by DICOM

Revision 26162  Directory Listing
Modified Fri Jul 21 19:36:34 2017 UTC (2 months ago) by ihnorton
ENH: translate Shift key must release before slice-scroll

Shift-mouse-move scrolls the slice views to correspond with the mouse position.

The problem is the following sequence:
- shift-click to pan
- then release the shift key before the mouse button
- the Shift-mouse-move scroll behavior is invoked and the slice positions jump somewhere random

With this PR, after a non-scroll shift operation, the shift key must be released once before the
default shift-mouse-move scrolling behavior is resumed.

ENH: add docstring for last commit

Revision 26152  Directory Listing
Modified Wed Jul 12 15:42:03 2017 UTC (2 months, 2 weeks ago) by lassoan
ENH: Added vtkSegmentationDisplayNode::UnsetSegmentOverrideColor

vtkSegmentationDisplayNode::UnsetSegmentOverrideColor is a convenience function
for removing previously set segment override color.

Revision 26151  Directory Listing
Modified Wed Jul 12 15:41:55 2017 UTC (2 months, 2 weeks ago) by lassoan
BUG: Fixed zip message logging

When archives were created, info messages (such as "Zip: adding") were logged as errors.

Revision 26146  Directory Listing
Modified Fri Jul 7 04:46:50 2017 UTC (2 months, 2 weeks ago) by lassoan
BUG: Fixed loading of DICOM series using quasi-matching filename

When slicer.util.loadVolume was used for loading a filename sometimes a different DICOM series was loaded
(https://discourse.slicer.org/t/windows-slicer-util-loadvolume-loads-wrong-volume/641).

The problem was that at some point the filename passed to slicer.util.loadVolume was compared to
file names in the directory without normalization. Due to differences in path separators
and capitalization of drive letter or file names, the comparison sometimes failed on Windows.

Fixed by normalizing filenames before comparison.

Revision 26144  Directory Listing
Modified Thu Jul 6 13:05:48 2017 UTC (2 months, 2 weeks ago) by lassoan
ENH: Made vtkMRMLTransformableNode::SetAndObserveTransformNodeID more robust

Check for circular reference when setting a parent transform has improved.
Circular reference is still possible if parent transform node IDs are set before
transform nodes are added to the scene.

Revision 26142  Directory Listing
Modified Sat Jul 1 00:01:31 2017 UTC (2 months, 3 weeks ago) by lassoan
ENH: Added lock window/level button to volume module

Window/level values of scalar volumes can be adjusted by click&drag on the slice view.
While this allows quick&easy tuning of the volume's appearance, in some cases it is too easy
to accidentally modify the volume.

Added a lock button to the window/level settings of Volumes module to enable/disable
modification on the GUI.

Note that window/level adjustment can also be disabled in the slice view interactor.

Revision 26141  Directory Listing
Modified Sat Jul 1 00:01:01 2017 UTC (2 months, 3 weeks ago) by lassoan
COMP: Fixed build warning

Revision 26137  Directory Listing
Modified Mon Jun 26 15:29:23 2017 UTC (2 months, 4 weeks ago) by jcfr
ENH: Updating SEM to integrate more explicitly named functions

- New Slicer Execution model version in Slicer (see Slicer/SlicerExecutionModel#91):

  $ git shortlog Slicer/SlicerExecutionModel@61bb14d..Slicer/SlicerExecutionModel@1d3e9a2 --no-merges
  Jean-Baptiste Vimort (2):
      STYLE: Renaming of the 'defaultValue' parameter's attribute to 'Value'
      ENH: Depreciation of the old functions

- Replace the use of deprecated functions with the new ones

- Deprecate the GetParameterDefault method: the GetParameterValue method
  should be used instead

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Reviewed-by: Johan Andruejol <johan.andruejol@kitware.com>
Reviewed-by: Steve Pieper <pieper@bwh.harvard.edu>

From: Jean-Baptiste VIMORT <jb.vimort@kitware.com>

Revision 26133  Directory Listing
Modified Sat Jun 24 18:27:37 2017 UTC (3 months ago) by pieper
BUG: remove error messages when testing if nrrd is tensor file

This change improves exception handling for the tensor reader so that
'expected' exceptions for incorrect number of components do
not trigger vtkErrorMacro output.  The extra error output
apparently led to false negative test failures on the dashboard.

Uses a more fine grained exception type for normal file variations
and generic exception for unexpected failure conditions.

Thanks @lassoan for reporting the issue!

From Andras:

I’ve noticed new vtkITKArchetypeDiffusionTensorImageReaderFile warnings when I load MRHead data set and there are also 11 new failed tests – related to image reading:

http://trunk.cdash.org/testDetails.php?test=8067501&build=1048542

http://trunk.cdash.org/viewTest.php?onlydelta&buildid=1048542

From: Steve Pieper <pieper@isomics.com>

Revision 26132  Directory Listing
Modified Fri Jun 23 05:13:49 2017 UTC (3 months ago) by lassoan
BUG: Reset transform sliders when switching between transforms

Fixes #4086 (https://issues.slicer.org/view.php?id=4086)

Revision 26130  Directory Listing
Modified Fri Jun 23 00:27:45 2017 UTC (3 months ago) by pieper
STYLE: improved comment

From: Steve Pieper <pieper@isomics.com>

Revision 26122  Directory Listing
Modified Fri Jun 23 00:27:33 2017 UTC (3 months ago) by pieper
ENH: select DCMTK or GDCM for all readers in vtkITK

This change removes places where GDCM would be used for
some aspects of image reading even though DCMTK was selected
as the preferred reader method.

Previously, some paths would rely on the itk factory to
pick the reader, which could choose GDCM.  Now the user's
choice is enforced if the data is DICOM.

From: Steve Pieper <pieper@isomics.com>

Revision 26121  Directory Listing
Modified Fri Jun 23 00:27:32 2017 UTC (3 months ago) by pieper
ENH: expose dicom header analysis flag in vtkITK reader

Add a method for this flag - the actual implementation
is not used anyway in slicer and should probably be removed
in the future.

The default value is still true for backward compatibility.

From: Steve Pieper <pieper@isomics.com>

Revision 26119  Directory Listing
Modified Fri Jun 23 00:25:03 2017 UTC (3 months ago) by pieper
ENH: better handling of ITK exceptions in vtkITK readers

Prviously ITK exceptions could be uncaught, by the vtkITK readers
and instead would be caught by the slicer application event
loop, which led to a dialog warning users of unstable conditions
and suggesting restart.  But usually these were really just
anticipated failure modes of file reading that were completely
recoverable.

This change catches these exceptions at the vtkITK layer and maps
them to vtkErrorCodes that can be checked at the reader level
to give a more controlled user experience.

From: Steve Pieper <pieper@isomics.com>

Revision 26117  Directory Listing
Modified Fri Jun 23 00:24:59 2017 UTC (3 months ago) by pieper
BUG: catch ITK exceptions when unable to read images

This logic now matches what was already in the vector version
of the same class.  The itk exception was being thrown for some
dicom data incorrectly read by gdcm.  Related to this discussion:

https://discourse.slicer.org/t/error-with-dce-mri-loading-in-dicom-browser/327/29

From: Steve Pieper <pieper@isomics.com>

Revision 26116  Directory Listing
Modified Fri Jun 23 00:24:58 2017 UTC (3 months ago) by pieper
STYLE: Use enum pattern for DICOM reader 'approach'

As discussed on discourse [1] we may want to allow different
ways of reading DICOM in the future, with this commit we
generalize the concept to use "approach" rather than "library"
since:
* we still use gdcm for some parts of the code
* we may still use dcmtk for reading if we define new
reading approaches in the future.

This commit also changes to using an enum to set
the approach so that the API can remain consistent in the
future.

[1] https://discourse.slicer.org/t/slicer-dicom-scalar-volume-plugin-relies-on-old-gdcm-why-do-we-not-use-dcmtk/354/17

From: Steve Pieper <pieper@isomics.com>

Revision 26114  Directory Listing
Modified Fri Jun 23 00:24:54 2017 UTC (3 months ago) by pieper
ENH: expose method to set itk metadatadictionary from reader

This method is visible to python and allows implementation
of the same reader functionality in the dicom scalar volume
plugin as in the mrml volume archetype storage node.

Updates DICOMScalarVolumePlugin to use the new method.

From: Steve Pieper <pieper@isomics.com>

Revision 26113  Directory Listing
Modified Fri Jun 23 00:24:52 2017 UTC (3 months ago) by pieper
ENH: enable selection of window/level presets in Volumes

Previously these had not been set by the dicom reader so the
box was always empty and non-functional.

Now the scalar volume plugin populates the displaynode
and these values are shwon in the volumes information widget.
When the user doubleclicks on an entry the display is set
accordingly.

From: Steve Pieper <pieper@isomics.com>

Revision 26111  Directory Listing
Modified Fri Jun 23 00:24:49 2017 UTC (3 months ago) by pieper
ENH: WIP: use dcmtk image IO to load scalar dicom

From: Steve Pieper <pieper@isomics.com>

Revision 26110  Directory Listing
Modified Fri Jun 23 00:24:47 2017 UTC (3 months ago) by pieper
ENH: do not use GDCM reader in this branch

From: Andrey Fedorov <andrey.fedorov@gmail.com>

Revision 26109  Directory Listing
Modified Fri Jun 23 00:24:46 2017 UTC (3 months ago) by pieper
ENH: add a flag to select image IO

Set/GetUseGDCMImageIO() can be used to switch between GDCM and DCMTK Image IO

From: Andrey Fedorov <andrey.fedorov@gmail.com>

Revision 26108  Directory Listing
Modified Fri Jun 23 00:24:44 2017 UTC (3 months ago) by pieper
ENH: replace GDCMImageIO with DCMTKImageIO for ArchetypeImageSeriesReader

From: Andrey Fedorov <andrey.fedorov@gmail.com>

Revision 26107  Directory Listing
Modified Thu Jun 22 16:08:29 2017 UTC (3 months ago) by lassoan
BUG: Fixed warping of markup fiducial labels

Warping of markup fiducial labels was caused by using perspective projection in overlay renderer's camera. See details in commontk/CTK#720.

By switching to parallel projection, default scaling of widgets have to be adjusted, and all other renderers should also use parallel projection to make point placing for widgets invariant to the renderer that is picked.

Revision 26106  Directory Listing
Modified Wed Jun 21 14:37:28 2017 UTC (3 months ago) by lassoan
BUG: Fixed build watning in vtkOrientedImageDataResample thresholding

Use double value for threshold and convert it to specific type in a safe manner.

Fixes #4229 (https://issues.slicer.org/view.php?id=4229)

Revision 26105  Directory Listing
Modified Tue Jun 20 17:16:54 2017 UTC (3 months ago) by lassoan
ENH: Removed terminology support from Colors module

Terminologies are now managed by a dedicated module (Terminologies) and used in segmentations modules.

Fixes #4320 (https://issues.slicer.org/view.php?id=4320)

Revision 26103  Directory Listing
Modified Sat Jun 17 12:00:59 2017 UTC (3 months, 1 week ago) by lassoan
ENH: Made scene modification detection more accurate

vtkMRMLScene::GetModifiedSinceRead() is used for deciding if scene file should be offered for saving by default in the Save dialog.
The behavior was to only offer to save the scene if nodes were added/removed, but that lead to losing data if the user accepted default save dialog settings.

For example, save scene, change some display parameters, save scene -> scene mrml file was not offered to be saved by default.

Revision 26091  Directory Listing
Modified Wed Jun 14 16:31:36 2017 UTC (3 months, 1 week ago) by lassoan
ENH: Improved transform widget display and apply transform sections

Simplified interaction section in transform display widget.
Synchronize interaction section in transform display widget with MRML node content.
Disable scaling interaction by default.
Keep Apply transform section closed until a transform is selected (to make the user interface more clear).
Disable widgets in Apply transform section until a transform node is selected.

Revision 26090  Directory Listing
Modified Wed Jun 14 16:31:22 2017 UTC (3 months, 1 week ago) by lassoan
BUG: Fixed transform rotation spinbox in Transforms module

When 0 degree was attempted to be changed by typing .1 the spinbox was reset to 0. The problem was that 0->0.1 means that the number of digits are changed, which triggered an update on all rotation sliders, which caused reset of all values. Fixed by making sure that the axis where spinbox that has the focus is not reset.

Fixed the problem of setting sliders to rotation type (after the scene was set it was necessary to set rotation type again, because unit-aware properties were overwritten when scene was set).

Changed Transforms module widget rotation angle spinbox step size to 0.1deg (0.1 deg is a quite visible difference). Further digits can be entered if more precision is needed.

Fixes #4365 (https://issues.slicer.org/view.php?id=4365)

Revision 26087  Directory Listing
Modified Tue Jun 13 18:05:54 2017 UTC (3 months, 1 week ago) by lassoan
ENH: Made DICOM file reading more robust with Add data

When "Add data" dialog is used for loading DICOM image by selecting a single file, vtkITKArchetypeImageSeriesReader::AnalyzeDicomHeaders() method is called that collects metadata from other files in the same subdirectory. Parsing of metadata was not very robust: having additional spaces made parsing fail and the application failed to match related files.

Solution: Made parsing more robust in vtkITKArchetypeImageSeriesReader::AnalyzeDicomHeaders() by removing all spaces from numerical fields.

Fixes #3569 (https://issues.slicer.org/view.php?id=3569).

Revision 26082  Directory Listing
Modified Sun Jun 11 12:53:24 2017 UTC (3 months, 2 weeks ago) by lassoan
ENH: Snap slice views to slice center after rotate to volume plane

Fixes #3886 (https://issues.slicer.org/view.php?id=3886)

Revision 26080  Directory Listing
Modified Sat Jun 10 21:00:57 2017 UTC (3 months, 2 weeks ago) by lassoan
BUG: Center view button now update clipping planes

Fixes 0004209 (https://issues.slicer.org/view.php?id=4209)

Revision 26079  Directory Listing
Modified Sat Jun 10 21:00:45 2017 UTC (3 months, 2 weeks ago) by lassoan
BUG: Fixed simple string members stored as node references

vtkCxxSetReferenceStringMacro is intended for setting node IDs only, as it registers the string value in the scene as a node reference.
It should not be used for simple strings.

In the long term, this macro should be retired and the MRML node references infrastructure should be used instead.

Revision 26077  Directory Listing
Modified Sat Jun 10 02:44:06 2017 UTC (3 months, 2 weeks ago) by ihnorton
ENH: refactor vtkNRRDWriter w/ MakeNRRD helper function

Revision 26070  Directory Listing
Modified Fri Jun 2 15:58:19 2017 UTC (3 months, 3 weeks ago) by lassoan
BUG: Prevent FreeSurfer overlay load from custom extensions

Revert change of allowing loading of FreeSurfer scalar overlays from custom extensions.
It interfered with the logic that determined what reader to use for loading model nodes.

Users may use composite file extensions that end with a standard extension.
For example, instead of lh.meanthickness_contrl these would all work:
lh.contrl.mean.thickness, lh.mean_contrl.thickness, lh_mean_contrl.thickness.

Revision 26068  Directory Listing
Modified Fri Jun 2 12:48:03 2017 UTC (3 months, 3 weeks ago) by lassoan
ENH: Fixed loading of FreeSurfer overlays with custom extensions

Loading of FreeSurfer scalar overlays from files were offered on the GUI for any file extensions,
but an internal check prevented loading from files with non-standard file extension (for example,
loading from lh.thickness worked but loading from lh.meanthickness_contrl did not).

Solved by assuming that overlays with custom file extensions can be read by vtkFSSurfaceScalarReader.

Revision 26067  Directory Listing
Modified Fri Jun 2 12:47:59 2017 UTC (3 months, 3 weeks ago) by lassoan
COMP: Fixed build warnings

Revision 26065  Directory Listing
Modified Thu Jun 1 16:32:21 2017 UTC (3 months, 3 weeks ago) by lassoan
ENH: Added 'Crop to reference image geometry' segmentation conversion option

If 'Crop to reference image geometry' is enabled, then when closed surfaces are converted to labelmaps,
the extent of the generated labelmap will be restriced to the reference image extent.
It is useful for importing large models that have irrelevant parts outside the reference image.

Revision 26064  Directory Listing
Modified Thu Jun 1 16:32:06 2017 UTC (3 months, 3 weeks ago) by lassoan
BUG: Fixed crosshair centered jump mode

When user translated a slice view, SliceOrigin was shifted and the crosshair did not appear in the center of the viewer.
When centering the viewer, SlicerOrigin has to be reset to (0,0,0).

Revision 26063  Directory Listing
Modified Thu Jun 1 14:53:50 2017 UTC (3 months, 3 weeks ago) by pinter
ENH: Simplified subject hierarchy node resolving process

Subject hierarchy node resolving happens when a second subject hierarchy node appears in the scene - usually when a scene is imported. Then merging of the new SH nodes into the first one happens, after which the new (and now empty) SH nodes are removed. It has been possible to observe items added when resolving using SubjectHierarchyItemResolvedEvent, but it was too complicated, as Add and Resolve basically mean the same operation, just in different states. Now SubjectHierarchyItemAddedEvent is invoked as usual when resolving, but it is now possible to get notified about resolving operations using SubjectHierarchyStartResolveEvent and SubjectHierarchyEndResolveEvent. This also allows processing after scene import without using a timer.

Revision 26062  Directory Listing
Modified Wed May 31 15:58:46 2017 UTC (3 months, 3 weeks ago) by lassoan
BUG: Removed memory leaks using GetNodesByClass from Python

GetNodesByClass creates a new collection that the caller has to take ownership of (the caller will have to delete).
Python automatically adds a reference, so we have to call UnRegister to remove the extra reference.

Revision 26059  Directory Listing
Modified Tue May 30 18:39:17 2017 UTC (3 months, 3 weeks ago) by lassoan
BUG: Removed all iteratorless traverse of shared collections

Collections have convenience functions for traversing it without the need for creating an iterator,
using InitTraversal() and GetNextItemAsObject(). These functions use an internal iterator stored in the collection.

Problem:

When a collection is traversed using the internal iterator by multiple functions at the same time, the behavior will be incorrect.

For collections that can be accessed by multiple objects, it is almost impossible to make sure that only one function will use
the internal iterator at a time. Therefore, shared collections must be traversed using external iterators.

For example, this error caused a bug in View Controllers module: it only showed the first slice view controller (while there were three). The problem was that View Controllers module iterated through the nodes using the internal iterator and internally a method was called that asked for a list of nodes by classname, which used the same internal iterator.

Solution:

- Replaced all instances of shared collection traversal with internal iterator.
- Made vtkMRMLScene's InitTraversal, GetNextNode, and GetNextNodeByClass methods deprecated (they are still functional,
  but log a warning when they are called).
- Added vtkMRMLScene::GetFirstNodeByClass convenience function and modified functions that used InitTraversal/GetNextNodeByClass
  or GetNthNodeByClass(0, ...) to use this function.

Revision 26054  Directory Listing
Modified Sat May 27 15:34:11 2017 UTC (3 months, 4 weeks ago) by lassoan
BUG: Fixed locking of checkable table columns

Revision 26053  Directory Listing
Modified Sat May 27 15:10:29 2017 UTC (3 months, 4 weeks ago) by lassoan
ENH: Improved table node

- Changed table schema column name:  "name" column in table schema looked like a regular property, it was not obvious that it refers to column name.
"columnName" is now used instead, to make the reference more explicit.
- Fixed copy-paste of bit type cells displayed as (checkboxes)
- Updated documentation
- Improved log messages and fixed.

Revision 26052  Directory Listing
Modified Sat May 27 01:11:23 2017 UTC (3 months, 4 weeks ago) by lassoan
ENH: Added schema file support for defining table column properties

Data type, default value, long name, description, unit, and any number of custom properties can now be defined for each column in a vtkMRMLTableNode.

Long name, description, and unit are shown in table view.
Data type is used for creating numeric arrays when reading the table.csv
Default value is used for initializing values in new rows.

Properties are stored in a schema file, which is a CSV or TSV file with the composite file extension .schema.csv (or .schema.csv or .schema.txt) with the same base filename as the data table file.

Revision 26051  Directory Listing
Modified Fri May 26 18:51:46 2017 UTC (4 months ago) by pinter
BUG: Fixed various subject hierarchy issues

- When the subject hierarchy node was removed programmatically, then subject hierarchy was not rebuilt, and became unusable. It's because vtkCommand::Delete was not called when removing it from python, as a reference from the console was still around, so vtkMRMLScene::NodeRemovedEvent is observed instead. Also plugin logic explicitly rebuilds the new subject hierarchy node when the original one was removed
- Added checks and removed unnecessary calls to remove unnecessary warning messages

Revision 26045  Directory Listing
Modified Thu May 25 15:31:34 2017 UTC (4 months ago) by lassoan
BUG: Fixed FreeSurfer overlay colormap table

Color names were overridden with default generated names (R=..., G=..., B=...).
Changed the color table name to match the overlay file it is read from.
Made overlay reading options in Add data dialog a bit more clear: added a "Apply to model:" label to the model node selector.

Revision 26039  Directory Listing
Modified Wed May 24 23:23:27 2017 UTC (4 months ago) by jcfr
STYLE: vtkITKArchetypeImageSeriesReader: Fix -Wsign-compare warnings

/path/to/Projects/Slicer/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.cxx: In member function ‘void vtkITKArchetypeImageSeriesReader::SetMetaDataScalarRangeToPointDataInfo(vtkImageData*)’:
/path/to/Projects/Slicer/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.cxx:903:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (nbrOfComponents != this->MetaDataScalarRangeMinima.size() ||
                         ^
/path/to/Projects/Slicer/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.cxx:904:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         nbrOfComponents != this->MetaDataScalarRangeMaxima.size())
                         ^
/path/to/Projects/Slicer/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.cxx:923:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (unsigned int i = 0; i < nbrOfComponents; ++i)
                                ^

Revision 26038  Directory Listing
Modified Wed May 24 23:23:26 2017 UTC (4 months ago) by jcfr
STYLE: vtkPolyDataToFractionalLabelmapFilter: Fix -Woverloaded-virtual warning

In file included from /path/to/Projects/Slicer-Release/VTKv7/Common/Core/vtkVariant.h:37:0,
                 from /path/to/Projects/Slicer-Release/Slicer-build/Libs/vtkSegmentationCore/vtkPolyDataToFractionalLabelmapFilterPython.cxx:10:
/path/to/Projects/Slicer-Release/VTKv7/Common/Core/vtkSetGet.h:312:14: warning: ‘virtual void vtkImageStencilSource::GetOutputOrigin(double&, double&, double&)’ was hidden [-Woverloaded-virtual]
 virtual void Get##name (type &_arg1, type &_arg2, type &_arg3) \
              ^
/path/to/Projects/Slicer-Release/VTKv7/Imaging/Core/vtkImageStencilSource.h:71:3: note: in expansion of macro ‘vtkGetVector3Macro’
   vtkGetVector3Macro(OutputOrigin, double);
   ^
In file included from /path/to/Projects/Slicer-Release/Slicer-build/Libs/vtkSegmentationCore/vtkPolyDataToFractionalLabelmapFilterPython.cxx:11:0:
/path/to/Projects/Slicer/Libs/vtkSegmentationCore/vtkPolyDataToFractionalLabelmapFilter.h:89:8: warning:   by ‘vtkPolyDataToFractionalLabelmapFilter::GetOutputOrigin’ [-Woverloaded-virtual]
   void GetOutputOrigin(double origin[3]);
        ^
In file included from /path/to/Projects/Slicer-Release/VTKv7/Common/Core/vtkVariant.h:37:0,
                 from /path/to/Projects/Slicer-Release/Slicer-build/Libs/vtkSegmentationCore/vtkPolyDataToFractionalLabelmapFilterPython.cxx:10:
/path/to/Projects/Slicer-Release/VTKv7/Common/Core/vtkSetGet.h:312:14: warning: ‘virtual void vtkImageStencilSource::GetOutputSpacing(double&, double&, double&)’ was hidden [-Woverloaded-virtual]
 virtual void Get##name (type &_arg1, type &_arg2, type &_arg3) \
              ^
/path/to/Projects/Slicer-Release/VTKv7/Imaging/Core/vtkImageStencilSource.h:81:3: note: in expansion of macro ‘vtkGetVector3Macro’
   vtkGetVector3Macro(OutputSpacing, double);
   ^
In file included from /path/to/Projects/Slicer-Release/Slicer-build/Libs/vtkSegmentationCore/vtkPolyDataToFractionalLabelmapFilterPython.cxx:11:0:
/path/to/Projects/Slicer/Libs/vtkSegmentationCore/vtkPolyDataToFractionalLabelmapFilter.h:95:8: warning:   by ‘vtkPolyDataToFractionalLabelmapFilter::GetOutputSpacing’ [-Woverloaded-virtual]
   void GetOutputSpacing(double spacing[3]);
        ^

Revision 26037  Directory Listing
Modified Wed May 24 23:23:24 2017 UTC (4 months ago) by jcfr
STYLE: vtkMRMLSubjectHierarchyNode: Fix sign-compare warning


/path/to/Slicer/Libs/MRML/Core/vtkMRMLSubjectHierarchyNode.cxx: In member function ‘bool vtkMRMLSubjectHierarchyNode::vtkInternal::ResolveUnresolvedItems()’:
/path/to/Slicer/Libs/MRML/Core/vtkMRMLSubjectHierarchyNode.cxx:1639:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (numberOfUnresolvedItems == this->UnresolvedItems->Children.size())
                                 ^

Revision 26036  Directory Listing
Modified Wed May 24 23:23:23 2017 UTC (4 months ago) by jcfr
STYLE: vtkSegmentationCore: Fix unused parameter warnings

Revision 26035  Directory Listing
Modified Wed May 24 19:09:23 2017 UTC (4 months ago) by lassoan
ENH: Added centered slice jump crosshair behavior

In Crosshair menu the user can now choose between slice jump with offset or centered (or jump slice disabled).

Revision 26033  Directory Listing
Modified Wed May 24 13:18:22 2017 UTC (4 months ago) by lassoan
BUG: Fixed qMRMLSpinBox maximum value setting

Revision 26032  Directory Listing
Modified Tue May 23 17:55:56 2017 UTC (4 months ago) by pinter
BUG: Rebuild subject hierarchy if resolve step fails

If the saved scene is invalid for some reason (in the scene attached to the error report there were empty unresolved items in the unresolved items list, and as they did not have valid parents, resolving them failed), then the subject hierarchy node is removed, which triggers re-building the hierarchy from scratch. The resulting hierarchy will be flat (except for the model and annotation hierarchies that can be rebuilt in SH), but at least there will be a valid subject hierarchy

Revision 26011  Directory Listing
Modified Mon May 15 15:46:24 2017 UTC (4 months, 1 week ago) by jcfr
ENH: Add support for MINC image IO

Issue #4085

This enables MINC Image IO via ITK. This currently supports MINC version 2
(HDF5-based).

Reviewed-by: Andriy Fedorov <fedorov@bwh.harvard.edu>
Reviewed-by: Andras Lasso <lasso@queensu.ca>
Reviewed-by: Johan Andruejol <johan.andruejol@kitware.com>
Reviewed-by: Gabriel A. Devenyi <gdevenyi@gmail.com>
Reviewed-by: Vladimir S. FONOV <vladimir.fonov@gmail.com>

Tested-by: Andras Lasso <lasso@queensu.ca>
Tested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Matt McCormick <matt.mccormick@kitware.com>

Revision 26007  Directory Listing
Modified Sat May 6 19:01:05 2017 UTC (4 months, 2 weeks ago) by jcfr
COMP: Update CTK and fix warnings

$ git shortlog a63253f..7129bb0 --no-merges
Jean-Christophe Fillion-Robin (2):
      Update QtTesting to fix overload warnings
      COMP: ctkErrorLogFDMessageHandler: Fix "unused-result" warning

Revision 26003  Directory Listing
Modified Sat May 6 04:52:18 2017 UTC (4 months, 2 weeks ago) by jcfr
STYLE: vtkMRMLSegmentationNode: Fix "unused parameters" warnings

Revision 26002  Directory Listing
Modified Sat May 6 04:52:16 2017 UTC (4 months, 2 weeks ago) by jcfr
STYLE: vtkMRMLScalarVolumeDisplayNode: Fix "narrowing conversion" warning

Revision 26001  Directory Listing
Modified Sat May 6 03:53:44 2017 UTC (4 months, 2 weeks ago) by jcfr
ENH: Ensure node loaded by volume logic respect default nodes

To that effect, this commit introduces the new method "vtkMRMLScene::AddNewNodeByClass()".
It allows to:

 (1) easily create a node by className, optionally set its name
     and then add it to the scene.

 (2) ensure properties of loaded node are initialized considering
     default nodes.

Suggested-by: Andras Lasso <lasso@queensu.ca>
Reviewed-by: Andras Lasso <lasso@queensu.ca>
Thanks: Andras Lasso <lasso@queensu.ca>

Revision 25998  Directory Listing
Modified Thu May 4 20:20:39 2017 UTC (4 months, 3 weeks ago) by pinter
BUG: Use segment ID in AddEmptySegment

Even if segment ID was specified, that argument was not used, and the segment name became the actual segment ID.

Revision 25997  Directory Listing
Modified Thu May 4 20:20:16 2017 UTC (4 months, 3 weeks ago) by lassoan
ENH: Allow disabling slice view interactions

For interventional applications it is often necessary to prevent the user from manipulating a slice view (change selected slice, adjust window width/level, etc).

SetActionEnabled/GetActionEnabled methods have been added to specify which actions are allowed in a slice view (default behavior is the same as before: all actions are allowed).

Example:
interactorStyle = slicer.app.layoutManager().sliceWidget('Red').sliceView().sliceViewInteractorStyle()
interactorStyle.SetActionEnabled(interactorStyle.BrowseSlice, False)

Revision 25981  Directory Listing
Modified Thu Apr 27 19:59:58 2017 UTC (4 months, 4 weeks ago) by johan.andruejol
BUG: Fix ConvertDeviceToXYZ() 1 pixel offset

The issue appeared when using an annotation. When the annotation point is
dragged at the bottom of a slice view, the annotation Z position would
jump 1 pixel higher.
For example in the axial view, the Z coordinate of the annotation would
jump from 0.0 to 1.0 (when no module is loaded).

Here is a small python code exerpt that can be used to showcase the bug:

def PrintP1(caller, event):
    p1 = [0, 0, 0]
    caller.GetPosition1(p1)
    print(p1)

ruler = slicer.mrmlScene.AddNode(slicer.vtkMRMLAnnotationRulerNode())
ruler.SetPosition1([0, 0, 0])
ruler.SetPosition2([10, 0, 0])
ruler.AddObserver(vtk.vtkCommand.ModifiedEvent, PrintP1)


Fixing the computation of Z in ConvertDeviceToXYZ() fixes this.

Revision 25967  Directory Listing
Modified Wed Apr 26 01:30:29 2017 UTC (5 months ago) by lassoan
BUG: Fixed miniscene import

Fixed premature node reference resolution during miniscene import.

Revision 25962  Directory Listing
Modified Tue Apr 25 18:51:13 2017 UTC (5 months ago) by pinter
BUG: Fixed issue when deleting virtual branches from subject hierarchy

Revision 25961  Directory Listing
Modified Tue Apr 25 18:13:46 2017 UTC (5 months ago) by pinter
ENH: Integration of Subject hierarchy into the Data module

The name of the subject hierarchy is not indicative to a user at all, and they may have difficulties finding out what the name actually covers. In the same time there is the Data module with an indicative name, but which has limited uses, and is mostly used to build transform hierarchies and for development purposes. It seems to make sense to "merge" the two modules, so that the now stable and fast subject hierarchy can be used where it is easiest to find.
- Made the Data module widget tabbed, with "Subject hierarchy", "Transform hierarchy", and "All node" tabs. Transform hierarchy contains the MRML tree from the previous Data module, showing only the transformable nodes. Note that ModelHierarchy and Displayable modes were not migrated, as Model hierarchies are supported by subject hierarchy, and if display properties are to be set, then the Models module is needed anyway. All nodes contains a flat list of MRML nodes showing all types of nodes
- Subject hierarchy made a hidden module, and all content removed from its module widget (so that it does not need to be maintained in two places
- Data module icon replaced with the subject hierarchy icon, and Subject hierarchy replaced by Data in the favorite module toolbar
- Added a button to "Explore Loaded Data" in Welcome module, and also updated text

Revision 25960  Directory Listing
Modified Tue Apr 25 05:05:03 2017 UTC (5 months ago) by lassoan
BUG: Fixed test errors

Recent changes removed extra spaces that were put in scene files when they were saved.
Baseline scene files had to be updated accordingly.

Revision 25945  Directory Listing
Modified Tue Apr 25 01:28:46 2017 UTC (5 months ago) by lassoan
BUG: Fixed referenced node observations

Observers were not added for referenced nodes when the referring node was added to the scene _after_ the node reference was specified.

Root cause: The problem was that when an individual node was added by scene->AddNode(), no node->UpdateNodeReferences was called, which was an issue
because node->UpdateNodeReferences converts referenced node ID to a node pointer and adds event observations.

Solution: Fixed by calling node->UpdateNodeReferences when not importing (importing is a special case: node IDs may change during import and
therefore conversion of node IDs to pointers must wait until the end of import).

Testing: Updated vtkMRMLTransformableNodeOnNodeReferenceAddTest to test node references defined both before and after adding the referring
node to the scene.

Revision 25943  Directory Listing
Modified Sat Apr 22 02:01:41 2017 UTC (5 months ago) by lassoan
BUG: Fixed null-pointer check

Revision 25940  Directory Listing
Modified Fri Apr 21 16:21:00 2017 UTC (5 months ago) by pinter
ENH: Added bimodal analysis to float and long volumes for auto-W/L

The bimodal analysis calculating a the auto window/level in a smart way was only applied when integer volumes were loaded. The reason for not supporting float, double, and long volumes is that the vtkImageBimodalAnalysis class handles the input image histogram with direct correspondence between bin index and voxel intensity. By automatically determining the histogram bins (instead of the constant -32K - +32K for the integer volumes), and converting the resulting W/L values back to intensity space, it is possible to use the bimodal filter for other volume types. It seems to work well for volumes with scalar ranges in the (-1000,3000) and (-1,2) too.

Revision 25938  Directory Listing
Modified Tue Apr 18 22:14:22 2017 UTC (5 months, 1 week ago) by agirault
ENH: Add support to read scalar range from header file

Offer a way to use the min/max information from the volume file meta data
to speed up the data loading.

Multiple file formats define properties in the header file to store the
scalar range, and ITK adds these info to the metadata dictionary that can
be retrieved using `itkObject::GetMetaDataDictionary()` :

Nifti (nii) - [cal_min, cal_max]
* format standard: https://nifti.nimh.nih.gov/nifti-1/documentation/nifti1fields/nifti1fields_pages/cal_maxmin.html
* itk support: https://github.com/InsightSoftwareConsortium/ITK/blob/f9110a0046a9d07a921767ba000443ad006a2c9b/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx#L887-L893
NRRD (nrrd/nhrd) - [min, max]
* format standard: http://teem.sourceforge.net/nrrd/format.html#min
* itk support: https://github.com/InsightSoftwareConsortium/ITK/blob/f9110a0046a9d07a921767ba000443ad006a2c9b/Modules/ThirdParty/NrrdIO/src/NrrdIO/NrrdIO.h.in#L1238-L1239
MetaIO (mha,mhd) - [ElementMin, ElementMax]
* format standard: https://itk.org/Wiki/MetaIO/Documentation#Tags_Added_by_MetaImage
* itk support: https://github.com/InsightSoftwareConsortium/ITK/blob/f9110a0046a9d07a921767ba000443ad006a2c9b/Modules/IO/Meta/src/itkMetaImageIO.cxx#L393-L401

Those scalar range values are retrieved and stored in
`vtkITKArchetypeImageSeriesReader::RequestInformation`
then set up in the image data point data scalars information in
`vtkITKArchetypeImageSeriesReader::SetMetaDataScalarRangeToPointDataInfo`,
called from its subclasses from `ExecuteDataWithInformation`
or `RequestData`.

From: Alexis Girault <alexis.girault@kitware.com>

Revision 25937  Directory Listing
Modified Tue Apr 18 22:14:20 2017 UTC (5 months, 1 week ago) by agirault
BUG: Correct lower threshold initial value

Use current level value and not previous level value (which at the first
call is hardcoded to an arbitrary value of 128)

From: Alexis Girault <alexis.girault@kitware.com>

Revision 25936  Directory Listing
Modified Tue Apr 18 14:40:01 2017 UTC (5 months, 1 week ago) by pinter
ENH: Added option in SH to transform by reparent

If an item is drag&dropped onto a transform in subject hierarchy, then the transformable nodes under the dragged item will be transformed by the parent transform item. Actual reparenting does not happen, only setting of the transform. The behavior is the same as when the user uses the transform column for the dragged item (including the popup about hardening/replacing transform)

Revision 25927  Directory Listing
Modified Fri Apr 14 02:39:32 2017 UTC (5 months, 1 week ago) by pinter
ENH: Added hint about context menus in subject hierarchy

Context menu was said to not be straightforward, and now with the two separate context menus it is even less. Tooltips have been added that pop up when entering subject hierarchy. If there is displayable data loaded, and the user enters subject hierarchy, a tooltip appears on the displayable item about the main context menu. On a second enter into the module, a tooltip appears for the visibility menu. The state of the shown hints is stored in application settings.

Revision 25924  Directory Listing
Modified Thu Apr 13 19:20:06 2017 UTC (5 months, 1 week ago) by pinter
BUG: Fixed subject hierarchy issues

- Crash when closing scene in certain cases (added checks for valid subject hierarchy node)
- Backwards-compatibility support for scenes that have the Level member instead of Level attribute

Revision 25912  Directory Listing
Modified Sat Apr 8 00:24:39 2017 UTC (5 months, 2 weeks ago) by jcfr
BUG: MRMLDisplayNode: print RGB values instead of pointers

In PrintSelf of the MRML display node, the pointers were being
printed rather than the RGB color values. EdgeColor was also not being
printed.

From: Nicole Aucoin <nicole.aucoin@harmonus.com>

Revision 25910  Directory Listing
Modified Fri Apr 7 18:11:52 2017 UTC (5 months, 2 weeks ago) by lassoan
ENH: Added convenience functions for segmentation manipulation

Makes it simpler to add/remove segments, create/delete representations, etc.

Revision 25904  Directory Listing
Modified Wed Apr 5 17:01:20 2017 UTC (5 months, 2 weeks ago) by pinter
ENH: Added SubjectHierarchyItemResolvedEvent to get notified about imported/restored items

Although it was already possible to get notifications of most subject hierarchy item events, it was not possible to add observations for adding items when importing a scene or restoring a scene view. Now, SubjectHierarchyItemResolvedEvent is invoked when a scene is being imported/restored (i.e. resolving unresolved items), allowing the developer to get notified about such events, similarly to how they can get notified about imported/restored MRML nodes.

Revision 25896  Directory Listing
Modified Mon Apr 3 15:23:15 2017 UTC (5 months, 3 weeks ago) by pinter
ENH: Removed explicit level member from subject hierarchy item

The reason for this is that level was somewhat confusing: all items for data nodes had series level by default, but it was not explicitly specified what it caused, and also the role of subseries level was unclear. Moreover as level was a member, it was expected to be non-empty, however in some cases it was not useful
Level is still available and used, but it's now a subject hierarchy item attribute, which is not mandatory. Convenience functions were preserved for level getting, setting, and checking, and added for creating patient, study, and folder items. So level argument was removed from functions where it was not useful, and the code is now a bit simpler

Revision 25895  Directory Listing
Modified Fri Mar 31 16:26:29 2017 UTC (5 months, 3 weeks ago) by pinter
BUG: Fixed randomizing order of dropped items in subject hierarchy

If multiple items were selected, and drag&dropped under a new parent, the order of the items under the new parent was randomized (to reproduce it was enough to load several MRHeads, drop them under a study in one move, then invoking DICOM export on the study - the items were in random order). Now it is fixed, and the order is preserved. Code complexity also decreased slightly.

Also style fix in terminology logic, and minor fix in DICOM export dialog UI

Revision 25892  Directory Listing
Modified Thu Mar 30 00:37:33 2017 UTC (5 months, 3 weeks ago) by lassoan
BUG: Fixed vtkOrientedImageData::GetExtent

In some cases, component 1, 3, 5 of vtkOrientedImageData was incorrectly computed as -1.

Revision 25890  Directory Listing
Modified Wed Mar 29 17:15:34 2017 UTC (5 months, 3 weeks ago) by pinter
BUG: Fixed color model header labels

Regression caused by https://github.com/Slicer/Slicer/pull/657

Revision 25874  Directory Listing
Modified Mon Mar 27 17:45:04 2017 UTC (5 months, 4 weeks ago) by pinter
ENH: Indicate master volume in Segmentations module and make selections

A label shows the master (reference) volume in the Segmentations module under the selected segmentation node, and the combobox of the reference volume for exporting to labelmap is populated

Revision 25871  Directory Listing
Modified Sat Mar 25 19:54:53 2017 UTC (6 months ago) by lassoan
COMP: Move projects to correct folder in solution explorer

vtkSegmentationCoreCxxTests and qSlicerModulesCoreCxxTests projects were moved to the correct folders in solution explorer
(now they are in the same folder as the projects that they test).

Revision 25870  Directory Listing
Modified Fri Mar 24 17:05:10 2017 UTC (6 months ago) by pinter
STYLE: Indentation related changes

1. vtkMRMLNode::Indent member seemed unused in the core, except from the also unused ROI list node, so the member was removed

2. In WriteXML functions, the increasing indentation was added between the XML attributes, which did not have major effect on the top level, but for example in the scene view section, where indentation was increased, it made the nodes look like this:

  <Selection
    id="vtkMRMLSelectionNodeSingleton"    name="Selection"    hideFromEditors="true"    selectable="true"    selected="false"    singletonTag="Singleton"

As the purpose of indentation is to add space in front of the _lines_, adding that space between the XML attributes seems unnecessary. With these changes, the same entry now looks like this:

  <Selection
    id="vtkMRMLSelectionNodeSingleton" name="Selection" hideFromEditors="true" selectable="true" selected="false"

History:

In the first implementation of `WriteXML()`, the name of the node (e.g vtkMRMLModelNode.cxx) was explicitly serialized and indented in the function by explicitly using `nIndent`.
See r40 (COMP: added vtkITK and MRML libs). Code like this was used:

    vtkIndent i1(nIndent);
    of << i1 << "<Model";

    of << " id='" << this->ID << "'";
    if (this->Name && strcmp(this->Name, ""))
    {
      of << " name='" << this->Name << "'";
    }
    [...]
    if (this->Color && strcmp(this->Color, ""))
    {
      of << " color='" << this->Color << "'";
    }

Then, this approach was reviewed in r133 (ENH: more transform functionality) by systematically calling the base class implementation of WriteXML() function.

Code above was then updated like this:

   Superclass::WriteXML(of, nIndent);
   vtkIndent indent(nIndent);

   if (this->Color && strcmp(this->Color, ""))
   {
     of << indent << " color='" << this->Color << "'";
   }

This commit simplifies the XML serialization and explicitly mark `indent` parameter as deprecated.

Revision 25869  Directory Listing
Modified Fri Mar 24 15:08:12 2017 UTC (6 months ago) by pinter
ENH: Terminology default contexts selection and validator link in messages

1. Last terminology and anatomic context selections are now saved in application settings, and are selected in case terminology navigator is opened for a new segment. Thus the default segment terminology is now empty (instead of Tissue/Tissue), so that new segment can be detected.
2. Link to the context validator web app is now included in the error message that is popped up when loading user terminology or anatomic context fails

Related to https://github.com/QIICR/QuantitativeReporting/issues/150

Revision 25867  Directory Listing
Modified Fri Mar 24 01:53:16 2017 UTC (6 months ago) by lassoan
ENH: Added option in ScreenCapture module for capturing all views

Revision 25864  Directory Listing
Modified Thu Mar 23 19:36:58 2017 UTC (6 months ago) by pinter
BUG: Fixed segment visibility indicator bug in subject hierarchy

When a segment was shown/hidden from somewhere else than SH, then the visibility icon in SH was not updated. By emitting modified event on the shown/hidden segment's SH item, the update is triggered.

Also, minor issues were fixed in SHNode::GetDisplayVisibilityForBranch. The new implementation of GetDataNodesInBranch includes the given node's data node itself in the returned collection, so no need to add that explicitly. Also, the exception about segmentation nodes were removed, as it was a workaround in the past when segmentation node was not registered in the scene. Further, the warning about partial visibility for leaf nodes was removed, because it can happen if a data node has more than one display node (e.g. annotations, fiber bundles)

Revision 25853  Directory Listing
Modified Tue Mar 21 14:44:03 2017 UTC (6 months ago) by pinter
BUG: Fixed scene views with subject hierarchy 2.0

Some explanation besides the subject hierarchy node and scene view node changes:
1. vtkMRMLScene.cxx:1140 and 1175:
1/A) the ReferencedIDChanges map contained an invalid entry in every case, namely it associated the last created node's ID with empty string.
1/B) In the case of loading a volume, the test scene created by vtkSlicerVolumesLogic::AddArchetypeVolume assigned ID with number 1 to the volume. Then, when adding it to the main MRML scene, the old ID with number 1 was found, and the ID change was stored always from 1 to the number of the last loaded volume. This is also an invalid ID change, as no ID was changed in the scene that stored this change. First approach was to clear node ID when removing from scene, but it caused tests failing in EMSegment (due to the specific way it creates sub-scenes), and it is expected to cause problems elsewhere too. So as an alternative solution, IDs are only added to ReferencedIDChanges, when a scene is being imported or a scene view restored. It seems to be reasonable, as these are the only two use cases where the IDs of other complete scenes need to be merged to the main Slicer scene.
2. vtkMRMLSegmentationNode.cxx: This is basically reverting commit rev25625 that introduced display node copying and creation in the data node's copy. In the case of restoring the scene view, it caused a problem like this: if the segmentation node was before its display node in the snapshot scene, a new display node was created when copying the segmentation node, and so after restoring, two display nodes were present instead of one. So the segmentation was not visible. I checked other data nodes and none of the ones I looked at copy display properties in the copy function of the data node. I suggest taking care of this at the higher level, where the data node's copy is called (for example as it is done in the clone node SH plugin)

Revision 25851  Directory Listing
Modified Mon Mar 20 17:01:32 2017 UTC (6 months ago) by ihnorton
STYLE: rename functions to match slicer/pr/647 rework

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25850  Directory Listing
Modified Mon Mar 20 17:00:42 2017 UTC (6 months ago) by ihnorton
ENH: change default DT glyph type to line, faster & clearer for normal use

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25849  Directory Listing
Modified Mon Mar 20 17:00:37 2017 UTC (6 months ago) by ihnorton
BUG: fix DT glyph display

Fixes issues related to slicer/pr/647 changes in model display pipeline.
- crash due to potential null node, needs null check.
- rendering problems (inactive by default) due to missing pipeline update call after event propagation was changed

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25839  Directory Listing
Modified Tue Mar 14 04:54:02 2017 UTC (6 months, 1 week ago) by jcfr
ENH: Add optional checkable column in qMRMLColorModel

* Remove LabelInColorColumn to be more consistent with qMRMLSceneModel
columns.
* Fix updateColorFromItem() that was always forcing the color opacity to be
1.0 because QColor rgba was always opaque.

From: Julien Finet <julien.finet@kitware.com>

Revision 25834  Directory Listing
Modified Tue Mar 14 03:18:36 2017 UTC (6 months, 1 week ago) by lassoan
BUG: Fixed SubjectHierarchy for nodes with SaveWithScene disabled

For nodes SaveWithScene=False, SH still contained a node ID reference in the scene. This caused incorrectly associating the SH node with an unrelated node existing in the scene with (accidentally) the same node ID.

When scene was loaded that contained invalid DataNode ID (because the node itself was missing from the scene) then the log message tried to print the DataNode pointer that was NULL, causing hang of the scene load (interestingly, the scene loading did not crash, probably some exception handler prevented that).

Revision 25829  Directory Listing
Modified Mon Mar 13 13:00:11 2017 UTC (6 months, 1 week ago) by jcfr
STYLE: Fix style of ITK classes using KWStyle

This commit introduced the style Utilities/KWStyle/ITK.kws.xml based of
the official ITK Style.

Style was checked using the following command:

  for file in $(find . | ack-grep "\/itk.+(h|cpp|txx|cxx)$"); do
    KWStyle -gcc -xml ./Utilities/KWStyle/ITK.kws.xml $file;
  done

KWStyle was built from source: https://github.com/Kitware/KWStyle

The following errors remain:

  ./Modules/CLI/ExpertAutomatedRegistration/ITKRegistrationHelper/itkAnisotropicSimilarity3DTransform.h:109: error: Internal variable (itk::Rigid3DTransform<TScalarType>::SetMatrix) doesn't match regular expression (m_[A-Z])
  ./Modules/CLI/ResampleDTIVolume/Testing/itkTestMainExtended.h:17: error: namespace not defined

Revision 25828  Directory Listing
Modified Mon Mar 13 13:00:02 2017 UTC (6 months, 1 week ago) by jcfr
STYLE: vtkITK/itkTimeSeriesDatabaseHelper: Remove unused code

Remove code that was added only if NO_MEMBER_TEMPLATES was *NOT* defined.

Revision 25827  Directory Listing
Modified Mon Mar 13 13:00:00 2017 UTC (6 months, 1 week ago) by jcfr
STYLE: Remove double underscore in header guards (.txx & __itk*_txx form)

Used the following command:

find . \( -iname *.txx -and -type f \) -exec perl -pi -w -e 's/__itk(.*)_txx/itk$1_txx/g;' {} \;

Fixes many, but not all, clang -Wreserved-id-macro warnings.

Adapted from scripts created by Sean McBride <sean@rogue-research.com> to
update ITK and VTK code base.

Revision 25826  Directory Listing
Modified Mon Mar 13 12:59:55 2017 UTC (6 months, 1 week ago) by jcfr
STYLE: Remove double underscore in header guards (.h & __itk*_h form)

Used the following command:

find . \( -iname *.h -and -type f \) -exec perl -pi -w -e 's/__itk(.*)_h/itk$1_h/g;' {} \;

Fixes many, but not all, clang -Wreserved-id-macro warnings.

Adapted from scripts created by Sean McBride <sean@rogue-research.com> to
update ITK and VTK code base.

Revision 25811  Directory Listing
Modified Sun Mar 12 19:44:08 2017 UTC (6 months, 2 weeks ago) by jcfr
COMP: qMRMLDisplayNodeWidget.ui: Fix invalid buddy assignment warning

Revision 25810  Directory Listing
Modified Sun Mar 12 19:44:06 2017 UTC (6 months, 2 weeks ago) by jcfr
COMP: itkMRMLIDImageIO: Fix -Wsometimes-uninitialized warning

Revision 25807  Directory Listing
Modified Sun Mar 12 19:44:00 2017 UTC (6 months, 2 weeks ago) by jcfr
COMP: vtkSlicerSceneViewsModuleLogic: Fix -Wunused-const-variable warning

This commit remove unused variable introduced in r24952 (ENH: Improved
axes-type orientation marker size and position)

Revision 25804  Directory Listing
Modified Sun Mar 12 19:43:53 2017 UTC (6 months, 2 weeks ago) by jcfr
COMP: vtkPolyDataToFractionalLabelmapFilter: Fix -Wbool-conversion warning

Revision 25802  Directory Listing
Modified Sun Mar 12 19:43:49 2017 UTC (6 months, 2 weeks ago) by jcfr
COMP: vtkITK: Fix -Wabsolute-value warning using std::abs

Revision 25799  Directory Listing
Modified Sun Mar 12 19:43:43 2017 UTC (6 months, 2 weeks ago) by jcfr
COMP: Fix unused variable warnings

Revision 25798  Directory Listing
Modified Sat Mar 11 23:59:23 2017 UTC (6 months, 2 weeks ago) by lassoan
ENH: Added vtkMRMLSubjectHierarchyNode:RequestOwnerPluginSearch for dataNodes

It works for data nodes that are not in the subject hierarchy yet.

Revision 25796  Directory Listing
Modified Sat Mar 11 14:34:57 2017 UTC (6 months, 2 weeks ago) by lassoan
ENH: Use VTK bounding box functions

Using vtkBoundingBox for adding points or bounds to a bounding box makes the code a bit simpler than adding custom methods.

Revision 25795  Directory Listing
Modified Sat Mar 11 07:10:11 2017 UTC (6 months, 2 weeks ago) by jcfr
COMP: vtkSubjectHierarchyItem: Fix sign-compare warning

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 25794  Directory Listing
Modified Sat Mar 11 07:10:09 2017 UTC (6 months, 2 weeks ago) by jcfr
COMP: vtkSubjectHierarchyItem: Fix reorder warning

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 25784  Directory Listing
Modified Sat Mar 11 07:09:50 2017 UTC (6 months, 2 weeks ago) by jcfr
COMP: vtkMRMLSubjectHierarchyNode: Fix ignored-qualifier warning

In file included from /path/to/Slicer/Modules/Loadable/SubjectHierarchy/Widgets/qSlicerSubjectHierarchyAbstractPlugin.h:33:0,
                 from /path/to/Projects/Slicer/Modules/Loadable/Segmentations/qSlicerSegmentationsModuleWidget.cxx:35:
/path/to/Projects/Slicer/Libs/MRML/Core/vtkMRMLSubjectHierarchyNode.h:164:43: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   static const vtkIdType GetInvalidItemID() { return INVALID_ITEM_ID; };
                                           ^

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 25780  Directory Listing
Modified Fri Mar 10 21:50:47 2017 UTC (6 months, 2 weeks ago) by pinter
BUG: Fixed segmentation bounds computation

This is a partial revert of rev25718. Using vtkMath::UninitializeBounds was incorrect, see comment in vtkOrientedImageData.h

Revision 25779  Directory Listing
Modified Fri Mar 10 20:07:05 2017 UTC (6 months, 2 weeks ago) by pinter
BUG: Fixed bug preventing from saving subject hierarchy attributes

This caused problems in subject hierarchy when saving/loading segmentations

Revision 25778  Directory Listing
Modified Fri Mar 10 18:00:46 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Add item cache in subject hierarchy node for increased speed in case of large scenes

Revision 25777  Directory Listing
Modified Fri Mar 10 16:46:19 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Changed invalid subject hierarchy item ID to 0 for easier checking

Revision 25776  Directory Listing
Modified Thu Mar 9 22:22:34 2017 UTC (6 months, 2 weeks ago) by pinter
BUG: Fixed middle item deletion in subject hierarchy

Revision 25774  Directory Listing
Modified Thu Mar 9 21:23:18 2017 UTC (6 months, 2 weeks ago) by pinter
BUG: Fixed issues around subject hierarchy DICOM UID references

Revision 25773  Directory Listing
Modified Thu Mar 9 21:01:12 2017 UTC (6 months, 2 weeks ago) by pinter
BUG: Fixed RemoveAllChildren method in subject hierarchy

It deleted the scene's immediate children, but in course of deletion, ReparentChildrenToParent was called (which is a feature to prevent such deletions to result dangling orphan items in memory), so the children of the top-level node's children were added under the scene, which were then not deleted. This caused a memory leak

Revision 25772  Directory Listing
Modified Thu Mar 9 13:29:32 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Request subject hierarchy owner plugin search when setting item attribute

Revision 25771  Directory Listing
Modified Wed Mar 8 20:30:39 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Allow requesting subject hierarchy owner plugin search from VTK environment

It is useful if an identifier attribute is added to the data node or the item after creation, and the developer wants a custom plugin to claim it

Revision 25770  Directory Listing
Modified Wed Mar 8 18:56:23 2017 UTC (6 months, 2 weeks ago) by lassoan
ENH: Added Python-wrappable vtkMRMLNode::GetAttributeNames

Revision 25769  Directory Listing
Modified Wed Mar 8 18:55:47 2017 UTC (6 months, 2 weeks ago) by lassoan
ENH: Improved vtkMRMLSubjectHierarchyNode PrintSelf formatting

Revision 25766  Directory Listing
Modified Wed Mar 8 02:57:18 2017 UTC (6 months, 2 weeks ago) by lassoan
BUG: Fix hang when clicking Edit properties in SH

In Subject hierarchy when right-clicked on a Segmentation node and chose "Edit properties", Slicer hung.

Revision 25765  Directory Listing
Modified Wed Mar 8 02:57:15 2017 UTC (6 months, 2 weeks ago) by lassoan
ENH: Made SH item name printing more clear

It was confusing that "(from DataNode)" was appended to the name. Changed formatting so that "(from DataNode)" is part of the label now.
Also added null-pointer check to GetName() as the node name can be NULL and Slicer should not crash if that happens.

Revision 25764  Directory Listing
Modified Wed Mar 8 02:57:12 2017 UTC (6 months, 2 weeks ago) by lassoan
BUG: Fixed vtkMRMLSubjectHierarchyLegacyNode::GetNodeTagName

Revision 25763  Directory Listing
Modified Wed Mar 8 02:57:07 2017 UTC (6 months, 2 weeks ago) by lassoan
ENH: Include MRML node class name in PrintSelf

Revision 25761  Directory Listing
Modified Tue Mar 7 20:58:40 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Additional various minor features and bugfixes for subject hierarchy 2.0

-----------------------------------------------
Details:

BUG: Added check to prevent crash when volume show/hide fails in SH

BUG: Fixed packaging error

ENH: Moved subject hierarchy node class registration to the scene

It allows using subject hierarchy in logic tests without instantiating a dummy subject hierarchy logic class.

ENH: Added level filter option to subject hierarchy tree and combobox

ENH: Added convenience methods to subject hierarchy node

Added convenience methods in subject hierarchy node for removing the children of an item (without removing the item itself), and for getting the number of children for an item

ENH: Improved segment editor subject hierarchy plugin

New segmentation node is created if the currently selected one is not empty; Segmentation node is renamed based on the master volume; Segmentation is placed under master volume in subject hierarchy

BUG: Fixed various minor issues, addressed TODOs

Revision 25760  Directory Listing
Modified Tue Mar 7 20:55:28 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Add backward compatibility support for old scenes containing SH

New node type vtkMRMLSubjectHierarchyLegacyNode is introduced, into which the subject hierarchy nodes from old MRML scenes are loaded, so that their information can be accessed and the hierarchy reconstructed. The new subject hierarchy nodes write a subject hierarchy version node attribute into the MRML scene on exporting. Most functions of the old subject hierarchy node were removed in the legacy node, and nly those methods are kept in this node from the old one that may be necessary to extract or use information loaded into this not and are not propagated into the new hierarchy (such as UIDs). Also, nested association support is also removed (because it never became completely stable), so if a scene is loaded where a data node is associated to the subject hierarchy node using nested association, then that node will not be properly represented in the hierarchy.

Revision 25759  Directory Listing
Modified Tue Mar 7 20:54:16 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Various minor features and bugfixes for subject hierarchy 2.0

-----------------------------------------------
Details:

BUG: Update subject hierarchy item info label when item is changed

Also added missing observations for items that are created when importing the scene

ENH: Improved usability for registration subject hierarchy plugin

A Cancel action appears when right-clicking the 'from' volume that allows canceling first selection, and also explains what to do to continue with registration

ENH: Changed subject hierarchy scene separator characters to support URLs

When serializing a URL, the character ':', which is the same as one of the separators, would confuse the deserializing function

BUG: Fixed issues in subject hierarchy display visibility

The symptom was that after display visibility was set, the item was not selected, thus there was a flickering of the data node inspector. The underlying cause was that subject hierarchy node modified event was invoked from the set visibility function that updated the whole tree.
Updating the whole tree now does not happen if the node is modified. Instead, the modified event is used to indicate to the scene that the content of the node was changed in some way. Thus, subject hierarchy node modified event is invoked in case of any subject hierarchy item event.
Also the parent items' icon was not updated when the visibility of the children changed. The previously existing mechanism was reinstated in SetDisplayVisibilityForBranch.

BUG: Fixed scripted subject hierarchy plugins on Mac/Linux

ENH: Added subject hierarchy node function to get number of items

ENH: Disable showing root item by default

ENH: Subject hierarchy folder plugin edit properties works

If a folder node corresponds to a model or annotation hierarchy node, Edit properties switches to Models or Annotations, depending on the hierarchy node

Revision 25754  Directory Listing
Modified Tue Mar 7 20:48:33 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Added subject hierarchy function to get parent data node by data node

Revision 25752  Directory Listing
Modified Tue Mar 7 20:47:00 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Implemented MRML scene save/import for subject hierarchy 2.0

-----------------------------------------------
Details:

STYLE: Removed commented-out items

Potentially useful code was left there commented with TODO comments. After implementing most subject hierarchy features and deciding they will not be needed, they were removed

ENH: DICOM export works

ENH: Updated subject hierarchy python tests

BUG: Fix various issues with segment handling in subject hierarchy

ENH: Merge subject hierarchies and resolve IDs after scene import

ENH: Subject hierarchy scene write added, MRML can be considered final

Revision 25751  Directory Listing
Modified Tue Mar 7 20:44:02 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Added long needed basic features made possible by new subject hierarchy design

- Re-ordering and expanded state are saved in the items, and restored on update
- Root item handling
- Subject hierarchy python scripted plugins
- Various bugfixes related to the above features and subject hierarchy core

-----------------------------------------------
Details:

BUG: Fixed subject hierarchy tree root item handling

ENH: Re-select items after drag&drop in subject hierarchy

BUG: Fixed subject hierarchy Register plugin

BUG: Fixed subject hierarchy reordering

It failed when an item was moved up not down

BUG: Fixed issues related to deleting subject hierarchy items

Also fixed the feature in DICOM plugin for converting folders into patients and studies

BUG: Fixed segmentation reparenting and visibility icon updates in SH

BUG: Fixed show/hide in subject hierarchy

ENH: Simplified creating subject hierarchy items

Instead of the Swiss army knife function that could be used to create subject hierarchy items for both data nodes and hierarchies (folder, study, etc.) there are two separate methods for CreateItem. One for creating the pure hierarchy items (folder etc.) and the other for the ones corresponding to data nodes. The latter is for internal use and should not be called.

Also fixed basic DICOM loading

ENH: Deploy scripted plugin in SubjectHierarchyPlugins folder

Previous commit deployed them in individual folders, but for consistency and simplicity, a common folder is better. It is achieved by having the __init__ script import all plugin python files dynamically

ENH: Added python scripted subject hierarchy plugins

For SegmentEditor (that replaces the core SegmentPlugin) and SegmentStatistics. Both are mostly sample plugins, to demonstrate how to write scripted plugins, and as a proof of concept for multiple scripted plugins built.
The reason why SegmentEditorSubjectHierarchyPlugins subfolder was chosen for source and install path: 1. If the plugin is added with the module file, it is attempted to be recognized as a module and will throw error 2. If a common SubjectHierarchyPlugins folder is created in each module having a scripted plugin, the __init__ files are not merged, but the last one overwrites the previous ones, and only one plugin is exposed.

ENH: Added subject hierarchy item info in SH module widget

It contains a label that displays the item's self print string.
Level and owner plugin info was removed from the tooltip, as the info box shows that, and it's not needed for normal usage (mostly for debugging)

BUG: Root item restored after complete subject hierarchy update

ENH: Subject hierarchy item expanded state handling added

BUG: Prevent crash when closing Slicer

BUG: Allow dropping subject hierarchy items on empty area

In which case it is reparented under the scene

ENH: Added item reordering support

Also fixed model update when item is reparented programmatically

Revision 25750  Directory Listing
Modified Tue Mar 7 20:37:27 2017 UTC (6 months, 2 weeks ago) by pinter
BUG: Initial bugfixes in subject hierarchy 2.0

-----------------------------------------------
Details:

BUG: Fixed item drag&drop in subject hierarchy tree

Implemented PrintSelf for subject hierarchy node

BUG: Enable python wrapping of SH functions by changing the ID type

The typedef that mapped vtkIdType to SubjectHierarchyItemID was not propagated to python, so the functions that had such an argument were not wrapped. Now vtkIdType is used directly instead.

Qt functions having vtkIdType arguments still cannot be called from python. Error similar to the one below occurs:
"ValueError: Called setRootItem(vtkIdType itemID) with wrong arguments: (0,)"

BUG: Plugin ownership, selection, context menu, and reparenting related fixes

BUG: Scene closing related fix and other small fixes

BUG: Basic fixes in refactored subject hierarchy

Revision 25749  Directory Listing
Modified Tue Mar 7 20:32:06 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Created single-node subject hierarchy mechanism, updated modules to build using it

-----------------------------------------------
Details:

ENH: Updated remaining classes. Build succeeds

ENH: Update subject hierarchy plugins and fix build errors

ENH: Subject hierarchy core builds alright

ENH: Updated SH tree view

Also moved model classes back to the module because they use SH specific functions (logic, etc.)

ENH: Updated SH proxy model and progress with new tree view

ENH: Automatic subject hierarchy creation and event processing

ENH: Subject hierarchy logic and plugin handler updated

to use new node and items

ENH: Added new subject hierarchy model WIP

New qMRMLSubjectHierarchyModel class added that will use the new subject hierarchy node for the data model. Removed AutoCreateSubjectHierarchy option from application settings, as it won't be needed with the new model in place. Subject hierarchy abstract plugin updated for new subject hierarchy node and items.

Remaining tasks: Subject hierarchy logic, all plugin classes, tree view, CLI support, extensions using SH, new SH features (model hierarchy support, reordering, expand state preservation, filtering in tree view by name)

ENH: Re-wrote vtkMRMLSubjectHierarchyNode to contain the whole tree WIP

The new subject hierarchy node contains the whole tree instead of representing an item in the tree. The advantages:
- No node duplication for the data nodes, only one extra node is in the scene. This means that SH can be turned on by default, so the extra step of enabling it will not be necessary
- No nested associations to support multiple types of hierarchies (mainly model hierarchy). Subject hierarchy will be able to co-exist with other hierarchies more easily, and those hierarchies can be imported into SH, so for example atlases can be used from SH
- Option to re-order nodes in the tree
- No subject hierarchy postfix in node names, thus decreased complexity and chance for error

Revision 25748  Directory Listing
Modified Tue Mar 7 20:23:14 2017 UTC (6 months, 2 weeks ago) by pinter
ENH: Removed unused OwnerPluginChanged event from SH

The event gave the chance to the old and new subject hierarchy plugin of a node to take steps when switching between owner plugins, but no plugin used it. Removing to decrease clutter before refactoring

Revision 25745  Directory Listing
Modified Mon Mar 6 15:48:56 2017 UTC (6 months, 2 weeks ago) by lassoan
BUG: Fixed segmentation undo/redo to preserve segment order

Revision 25744  Directory Listing
Modified Fri Mar 3 22:26:09 2017 UTC (6 months, 3 weeks ago) by jcfr
BUG: Fix setting of slice viewer offset

This commit fixes a regression introduced in r25741 (ENH: Remove
sliceBounds assert from qMRMLSliceControllerWidgetPrivate) where
the logic originally captured by the Q_ASSERT was incorrectly
adapted.

Reported-by: Neal Siekierski <neal.siekierski@kitware.com>

Revision 25741  Directory Listing
Modified Wed Mar 1 18:59:52 2017 UTC (6 months, 3 weeks ago) by lassoan
ENH: Remove sliceBounds assert from qMRMLSliceControllerWidgetPrivate

Removed Q_ASSERT(sliceBounds[4] <= sliceBounds[5]), as invalid slice bounds is not an error (it just means there is no content in the slice view).

Revision 25737  Directory Listing
Modified Wed Mar 1 18:59:40 2017 UTC (6 months, 3 weeks ago) by lassoan
BUG: Fixed Island effect split method

Island effect split method was failing on linux and mac because vtkITKIslandMath filter does not work with long input scalar type on linux and mac

Revision 25736  Directory Listing
Modified Wed Mar 1 18:59:36 2017 UTC (6 months, 3 weeks ago) by lassoan
BUG: Fixed scene saving

Saved scene was corrupted due to missing " character

Revision 25733  Directory Listing
Modified Tue Feb 28 00:09:08 2017 UTC (6 months, 3 weeks ago) by agirault
ENH: Added straight vs whole cell clipping option for meshes

See: http://na-mic.org/Mantis/view.php?id=4335

From: Sam Horvath <sam.horvath@kitware.com>

Revision 25732  Directory Listing
Modified Mon Feb 27 15:15:28 2017 UTC (6 months, 3 weeks ago) by pieper
COMP: add custom widget declaration to get correct case

Without this declaration, a linux build results in a missing
header ctksliderwidget.h.  On windows or on mac with a non-case
sensitive file system this wouldn't be an error.

From: Steve Pieper <pieper@isomics.com>

Revision 25731  Directory Listing
Modified Mon Feb 27 14:22:02 2017 UTC (6 months, 3 weeks ago) by agirault
ENH:  Added opacity setting for 2D slice intersections

See: http://na-mic.org/Mantis/view.php?id=4334

From: Sam Horvath <sam.horvath@kitware.com>

Revision 25728  Directory Listing
Modified Fri Feb 24 22:20:13 2017 UTC (6 months, 4 weeks ago) by jcfr
ENH: Update CTK to include ctkFittedTextBrowser fix

git shortlog fc0b1b7..443dc27 --no-merges
Andras Lasso (1):
      BUG: Fixed ctkFittedTextBrowser height computation for wide content

Jean-Christophe Fillion-Robin (6):
      circleci: Rename image "ctk-test:opengl" into "ctk-test:opengl-qt4"
      circleci/Dockerfile-qt4: Speed up package install and optimize image size
      circleci: Add support for testing Qt5 build
      DICOM/Widgets: Fix "unused-but-set-variable" warning
      XNAT/Core: Fix warnings
      XNAT/Core: Fix unused warning in ctkXnatObject::fetchResources

Julien Finet (2):
      Increment QtTesting version
      Fix compilation with Qt < 5.1.1

Stephen R. Aylward (1):
      BUG: Missing vtkRenderingFreeType library option

Revision 25718  Directory Listing
Modified Wed Feb 22 07:17:27 2017 UTC (7 months ago) by lassoan
BUG: Fixed bounds computation in vtkMRMLVolumeNode and vtkMRMLSegmentationNode

When volume or segmentation was empty sometimes non-empty bounds were returned.

Revision 25713  Directory Listing
Modified Tue Feb 21 16:35:43 2017 UTC (7 months ago) by lassoan
STYLE: Improved API documentation of qMRMLLayoutManager::mrmlSliceLogics()

Revision 25711  Directory Listing
Modified Sun Feb 19 03:39:56 2017 UTC (7 months ago) by lassoan
ENH: Added slice view zoom in/out using Ctrl+MouseWheel

Revision 25710  Directory Listing
Modified Sat Feb 18 04:29:56 2017 UTC (7 months ago) by lassoan
BUG: Fixed slice spacing computation

When a slice axis is not aligned with a volume axis then slice spacing is computed using elliptical interpolation.

Revision 25701  Directory Listing
Modified Wed Feb 8 22:58:19 2017 UTC (7 months, 2 weeks ago) by lassoan
BUG: Fixed "Bad plane coordinate system" error on startup

On Slicer startup, one of the slice planes had temporarily invalid configuration (two axes were parallel).
Placed plane update inside a StartModify/EndModify block to prevent using plane source output before it is fully updated.

Revision 25698  Directory Listing
Modified Wed Feb 8 18:30:22 2017 UTC (7 months, 2 weeks ago) by jcfr
ENH: Interaction for transform node

The transform will automatically be centered around whatever objects
it transforms at the moment when the TransformUpdateEditorBoundsEvent is
invoked. This is more intuitive to the user as it looks as if the object under
the transform itself is moved/scaled/translated.
When no object is present, the transform is just scaled to facilitate
interaction with it.

Testing is added to ensure that:
 - The widget holds correctly the objects it will transform. Furthermore this
test is perfomed with models to extend the coverage as transform interaction
can theoritically deal with any vtkMRMLDisplayableNode.
 - Testing for interacting with transforms with parents
 - Serialization and deserialization of the scene

The transform interaction is only valid linear transforms

From: Johan Andruejol <johan.andruejol@kitware.com>

Revision 25696  Directory Listing
Modified Wed Feb 8 18:30:16 2017 UTC (7 months, 2 weeks ago) by jcfr
ENH: Add GetNodeBounds to return untransformed bounds of node

Also add a vtkSlicerTransformLogic method that get the bounds of a list of
nodes.

From: Johan Andruejol <johan.andruejol@kitware.com>

Revision 25694  Directory Listing
Modified Wed Feb 8 05:40:01 2017 UTC (7 months, 2 weeks ago) by lassoan
BUG: Fixed slice spacing computation

Slice spacing was incorrectly computed for non-axis-aligned volumes.

This caused issues such as being able to go outside a single-slice volume in a slice view when with the arrow key. What the user saw was that when he accidentally moved the mouse wheel then the image disappeared from the slice viewer.

Revision 25692  Directory Listing
Modified Tue Feb 7 04:01:56 2017 UTC (7 months, 2 weeks ago) by lassoan
BUG: Fixed loading of RGB volumes

SingleFile flag was often incorrect in saved scenes, because some file formats store a volumetric image in multiple files,
while in another format the same data can be saved in a single file; but the singleFile flag was not updated when file format
was changed. This caused loading error for RGB volumes when there were multiple files with similar names in the same directory.

Solution: Don't save SingleFile flag to the scene (it is just a temporary hint for file reading anyway), but set its value
based on GetNumberOfFileNames() value.

Revision 25689  Directory Listing
Modified Mon Feb 6 21:45:04 2017 UTC (7 months, 2 weeks ago) by lassoan
ENH: Added orientation normalization utilities to vtkAddon

Added new utility methods to vtkAddonMathUtilities:
* SetOrientationMatrix
* NormalizeColumns
* NormalizeOrientationMatrixColumns

They are useful for getting/setting and normalizing orientation part
of a homogeneous transformation matrix.

Revision 25688  Directory Listing
Modified Mon Feb 6 21:45:01 2017 UTC (7 months, 2 weeks ago) by lassoan
STYLE: Removed comments, unnecessary space

Revision 25687  Directory Listing
Modified Mon Feb 6 21:44:58 2017 UTC (7 months, 2 weeks ago) by lassoan
ENH: Convert empty VTK transform to identity ITK transform

When vtkGeneralTransform is initialized to Identity() then it creates a transform with 0 items in it.
So, it cannot be considered to be an error to have a vtkGeneralTransform with 0 items.
Instead, it has to be treated as an identity transform.

Revision 25684  Directory Listing
Modified Tue Jan 31 02:59:31 2017 UTC (7 months, 3 weeks ago) by lassoan
ENH: Restore model slice intersection opacity behavior

Previously, model slice intersection opacity was always 100%.
Recently behavior was modified to use the same opacity as in 3D, but this new behavior is often not ideal.

Restored the old behavior until a new slice intersection opacity attribute is introduced.

Revision 25682  Directory Listing
Modified Mon Jan 30 17:20:08 2017 UTC (7 months, 3 weeks ago) by lassoan
BUG: Fixed model node related test errors

"Could not retrieve mesh connection producer" error was logged when a mesh was not set.
This is not an error case in general, so there is no need to log as error.

Revision 25681  Directory Listing
Modified Sun Jan 29 03:58:53 2017 UTC (7 months, 3 weeks ago) by lassoan
BUG: Fix vtkMRMLModelNode ApplyTransform & GetMesh

Reverts regression introduced in r25660 [1] by applying the transformation
to the mesh data object directly if the mesh was set with SetAndObserveMesh
(which uses vtkTrivialProducer to generate its mesh connection) and was not
set as a mesh connection being part of a pipeline.

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25660

Also call vtkAlgorithm::Update() in vtkMRMLModelNode::GetMesh() to
ensure the mesh connection is up to date when getting its output data
object.

Also remove changes to MeshType and calls to Modified() in GetPolyData()
and GetUnstructuredGrid(). Those were triggered when data inconsistency
was detected, but a Get() method should never modify an object. Keep
warnings only.

Revision 25679  Directory Listing
Modified Fri Jan 27 22:20:04 2017 UTC (7 months, 3 weeks ago) by agirault
BUG: Fix model display pipeline calls

The ThresholdFilter and AssignAttribute filters do not need to call
Update() when they are modified: VTK will take care of running the
filters when data is requested by the renderer.

Still need to call update in UpdateScalarRange() to be able to
retrieve the scalar range of the AssignAttribute filter output mesh
if UseDataScalarRange, as well as in GetOutputMesh().

Fixed tests:
* qSlicerModelsModuleWidgetTest
* qMRMLModelDisplayNodeWidgetTest1

Revision 25678  Directory Listing
Modified Fri Jan 27 22:17:12 2017 UTC (7 months, 3 weeks ago) by agirault
BUG: remove obsolete unstructured grid tests

vtkMRMLUnstructuredGridNode and its components were removed in r25666 [1],
but the tests were not undefined in Libs/MRML/Core/Testing/CMakeLists.txt

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25666

Replace scene tests using unstructured grid by scene tests using
volumetric mesh.

Revision 25675  Directory Listing
Modified Fri Jan 27 15:45:21 2017 UTC (7 months, 4 weeks ago) by lassoan
ENH: Made thin-plate spline transform writing error log message more clear

Revision 25669  Directory Listing
Modified Wed Jan 25 00:18:22 2017 UTC (8 months ago) by lassoan
COMP: Fixed vtkMRMLProceduralColorNode build error on Windows

VS2013 threw this error:
42>C:\D\S4\Libs\MRML\Core\vtkMRMLProceduralColorNode.cxx(145): error C2057: expected constant expression [C:\D\S4RD\Slicer-build\Libs\MRML\Core\MRMLCore.vcxproj]
42>C:\D\S4\Libs\MRML\Core\vtkMRMLProceduralColorNode.cxx(145): error C2466: cannot allocate an array of constant size 0 [C:\D\S4RD\Slicer-build\Libs\MRML\Core\MRMLCore.vcxproj]
42>C:\D\S4\Libs\MRML\Core\vtkMRMLProceduralColorNode.cxx(145): error C2133: 'bareTable' : unknown size [C:\D\S4RD\Slicer-build\Libs\MRML\Core\MRMLCore.vcxproj]

Revision 25668  Directory Listing
Modified Tue Jan 24 23:22:42 2017 UTC (8 months ago) by lassoan
BUG: Fixed vtkNRRDReader for large images

Slicer crashed when nrrd image larger than 2GB was attempted to be loaded.
The issue was that at two places 32-bit variables were used for computing total number of bytes in the image.

Revision 25666  Directory Listing
Modified Tue Jan 24 22:23:16 2017 UTC (8 months ago) by agirault
ENH: Get rid of vtkMRMLUnstructuredGridNode

As well as its display and storage nodes.

That class was not used, and support for vtkUnstructuredGrid
is now added within the vtkMRMLModelNode.

Revision 25665  Directory Listing
Modified Tue Jan 24 22:23:13 2017 UTC (8 months ago) by agirault
ENH: Improve MRML Model tests

Revision 25664  Directory Listing
Modified Tue Jan 24 22:23:11 2017 UTC (8 months ago) by agirault
ENH: Add Thresholding for vtkMRMLModelDisplayNode

Revision 25663  Directory Listing
Modified Tue Jan 24 22:23:09 2017 UTC (8 months ago) by agirault
ENH: Consolidate AutoScalarRange & ScalarRangeFlag

AutoScalarRange - in vtkMRMLDisplayNode -  would define if the
ModelDisplayNode would reset its ScalarRange to map the range
of the mesh active scalar or not (manually set by the user).

ScalarRangeFlag - in vtkMRMLDisplayNode - would define if the
ModelDisplayableManager would map scalar range based on the
active scalar if UseDataScalarRange (same that AutoScalarOn),
would use the DataType range if UseDataTypeScalarRange, would
use the color node lookup table range if UseColorNodeScalarRange,
or would use the display node scalar range (aka its OWN range
defined by AutoScalarRange value) if UseDisplayNodeScalarRange.

To consolidate those two class members which show redundancies,
they are replaced by a unique ScalarRangeFlag which can take the
following values:
* UseManualScalarRange (new, equivalent to AutoScalarRangeOff)
* UseDataScalarRange (as previously, equivalent to AutoScalarRangeOn)
* UseColorNodeScalarRange (as previously)
* UseDataTypeScalarRange (as previously)
Note the removal of `UseDisplayNodeScalarRange`.

For backward compatibility, the AutoScalarRange API is conserved
and wraps Set/GetScalarRangeFlag.

The range update based on this ScalarRangeFlag is then made in
vtkMRMLModelDisplayNode::UpdateMeshPipeline instead of
vtkMRMLModelDisplayableManager::SetModelDisplayProperty, which
simplifies greatly the code in the displayable manager by only
calling `mapper->SetScalarRange(modelDisplayNode->GetScalarRange())`,
and allows that call in vtkMRMLModelSliceDisplayableManager to
now return the correct range based on that option.

vtkMRMLModelSliceDisplayableManager is also updated to instantiate
the vtkMapper in a similar way than it is made in the 3D displayable
manager for visualization consistency (deep copy of the lut, etc...)

Revision 25662  Directory Listing
Modified Tue Jan 24 22:23:06 2017 UTC (8 months ago) by agirault
ENH: Implement vtkMRMLProceduralColorNode::GetLookupTable

Migrate conversion of ColorTransferFunction to LookupTable
from ModelDisplayableManager to ProceduralColorNode, to
simplify code in the displayable manager, and to be able to
reuse that conversion code for ModelSliceDisplayableManager.

Revision 25661  Directory Listing
Modified Tue Jan 24 22:23:04 2017 UTC (8 months ago) by agirault
STYLE: Use actorProperties in Model displayable manager

Revision 25660  Directory Listing
Modified Tue Jan 24 22:23:02 2017 UTC (8 months ago) by agirault
ENH: Add volumetric mesh support in vtkMRMLModelNode

See: https://www.na-mic.org/Wiki/index.php/2017_Winter_Project_Week/Support_for_volumetric_meshes

Update vtkMRMLModelNode to store a vtkPointSet instead of a
vtkPolyData. vtkPointSet can be a base class for vtkPolyData
(surface mesh) as well as vtkUnstructuredGrid (volumetric mesh).

The safest way to know if the mesh is unstructuredGrid is to
check if `vtkMRMLModelNode::GetUnstructuredGrid()` is not NULL,
but since it requires to update the pipeline, vtkMRMLModelNode
also has a member variable called `MeshTypeHint`.

For backward compatibility, keep the public polydata-based API
and wrap around the mesh-based API in vtkMRMLModelNode and
vtkMRMLModelDisplayNode.

Update vtkMRMLModelDisplayNode, vtkMRMLModelDisplayableManager,
vtkMRMLModelSliceDisplayableManager, and qMRMLModelDisplayNodeWidget
to use the mesh-based API by default.

Revision 25657  Directory Listing
Modified Tue Jan 24 16:41:54 2017 UTC (8 months ago) by jcfr
BUG: Fix slice bounds for volumes not RAS aligned

See #4077

From: Julien Finet <julien.finet@kitware.com>

Revision 25654  Directory Listing
Modified Tue Jan 24 02:40:53 2017 UTC (8 months ago) by jcfr
STYLE: vtkMRMLColorNode, qMRMLThreeDView: Fix sign-compare warning

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 25653  Directory Listing
Modified Tue Jan 24 02:40:50 2017 UTC (8 months ago) by jcfr
STYLE: Fix unused variable warnings

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 25651  Directory Listing
Modified Mon Jan 23 21:30:20 2017 UTC (8 months ago) by agirault
ENH: Expose functions for reproducing 3D view shortcuts

Before this, there was no simple way to ask programaticaly for the view
to reset the camera like it does when pressing the key pad shortcut keys.
Now the user can do this directly from python. This is potentially useful
for the scripted modules as well.

Revision 25649  Directory Listing
Modified Mon Jan 23 20:58:34 2017 UTC (8 months ago) by agirault
STYLE: Expose utility methods in qMRMLColor

Move GetColorIndexByName from vtkMRMLColorTableNode
to vtkMRMLColorNode to expose it in qMRMLColorModel
and qMRMLColorTableView

Co-authored-by: Alexis Girault <alexis.girault@kitware.com>

Revision 25647  Directory Listing
Modified Mon Jan 23 15:44:17 2017 UTC (8 months ago) by johan.andruejol
STYLE: Fix constness of methods in qMRMLSliceView

Revision 25646  Directory Listing
Modified Sat Jan 21 23:04:24 2017 UTC (8 months ago) by lassoan
ENH: Added CLI output display to module widget

Problem:
It is often difficult to find out why a CLI failed or get detailed output.
(user would need to open the log window and find the messages in the log,
but most users don't even know that there is a log window).

Solution:

Expand button is added next to the status message.
User can click there to show/hide all details.
Error output is displayed in red, at the top. Standard output is displayed black.
Window is automatically sized to show all content with minimal need for scrolling.

If CLI completes with errors, error output is displayed regardless of show/hide details choice.

Revision 25642  Directory Listing
Modified Thu Jan 19 17:21:14 2017 UTC (8 months ago) by lassoan
BUG: Fix ITK transform conversion crash

Lack of ITK dynamic_cast requires yet another workaround.

Problem: When a CLI returned a transform with dimension != 3 it made Slicer crash.
Solution: Verify transform dimension before static_cast (not just scalar type and transform type).

Revision 25639  Directory Listing
Modified Thu Jan 12 20:24:29 2017 UTC (8 months, 1 week ago) by lassoan
ENH: Improved slice viewer WW/WL and blending

* Blending now supports blending segmentation (not just labelmaps). If no labelmap is selected to be
  shown in the slice viewer then it blends visible segmentation.
* Blending and window level adjustment handles saturation of the values. For example,
  if mouse is moved so much that opacity or window level is saturated and then you move back to the other direction,
  the saturated value starts to get decrease immediately.
* Simplified and removed several unnecessary code from vtkSliceViewInteractorStyle class.

Revision 25636  Directory Listing
Modified Thu Jan 12 20:24:17 2017 UTC (8 months, 1 week ago) by lassoan
STYLE: Updated vtkMRMLSegmentationNode documentation

Revision 25625  Directory Listing
Modified Wed Dec 28 22:46:32 2016 UTC (8 months, 3 weeks ago) by lassoan
BUG: Fixed vtkMRMLSegmentationNode::DeepCopy

Display and storage nodes are now cloned, too (these nodes should not be shared).

Revision 25624  Directory Listing
Modified Mon Dec 26 18:38:04 2016 UTC (8 months, 4 weeks ago) by lassoan
ENH: Simplified vtkMRMLColorLogicTest2

Revision 25622  Directory Listing
Modified Fri Dec 23 15:40:15 2016 UTC (9 months ago) by lassoan
BUG: Fixed crash in scene view node saving

Revision 25620  Directory Listing
Modified Thu Dec 22 04:46:07 2016 UTC (9 months ago) by lassoan
ENH: Improved backward compatibility of segment color loading

In older scenes, segment color is stored in ColorX attributes, while in new scenes override segment color is stored in OverrideColorX attributes.
To better preserve segment color, interpret ColorX attributes as override color.

Revision 25616  Directory Listing
Modified Wed Dec 21 01:42:45 2016 UTC (9 months ago) by lassoan
ENH: Turned on output testing for MRML logic tests

Output testing makes the test fail if any unexpected VTK errors or warnings are logged (and it also makes VTK logs visible on the dashboard).
Fixed test failures (they were all test errors).

Revision 25615  Directory Listing
Modified Wed Dec 21 01:42:37 2016 UTC (9 months ago) by lassoan
BUG: Fixed error in file extension parsing

The bug was introduced yesterday as a side effect.

Revision 25613  Directory Listing
Modified Tue Dec 20 02:27:07 2016 UTC (9 months ago) by lassoan
BUG: Fixed file extension extraction logic

For transform file sometransform_version2.0_some.h5 it returned .0_some.h5 as extension (instead of the correct .h5).

Solution: wildcard matching is only used if no specific extension is matched.

Revision 25610  Directory Listing
Modified Wed Dec 14 18:17:58 2016 UTC (9 months, 1 week ago) by pinter
ENH: Default segment names and terminologies; changed terminology selector layout

By default segments get consecutive colors from the generic anatomy color table, Tissue/Tissue terminology entry, and the same name as before (Segment_N). They now store whether name and color are automatically generated, and the auto-generated values only override these values if they were not manually changed.
Terminology selector layout has been changed, and name field added on the bottom.

Revision 25605  Directory Listing
Modified Sun Dec 11 13:38:57 2016 UTC (9 months, 2 weeks ago) by lassoan
BUG: Restored previous layout behavior

Enabling cached views in layouts caused regression in compare layouts.
Restoring previous behavior until fix is implemented in CTK.

Revision 25604  Directory Listing
Modified Sun Dec 11 02:49:15 2016 UTC (9 months, 2 weeks ago) by lassoan
BUG: Fixed tabbed slice and 3D view layouts

Problem: only one view shows up in Tabbed slice and Tabbed 3D layouts.

Root cause: UseCachedViews in layout factory was disabled, which prevented reusing views created by other layouts in tabbed layouts.

Solution: Use default UseCachedViews setting (caching enabled).

Revision 25603  Directory Listing
Modified Thu Dec 8 22:41:36 2016 UTC (9 months, 2 weeks ago) by jcfr
ENH: vtkMRMLVolumeNodeTest1: Test "IJKtoRAS to/from ScanOrder" conversion

Revision 25599  Directory Listing
Modified Thu Dec 8 22:37:47 2016 UTC (9 months, 2 weeks ago) by jcfr
STYLE: vtkMRMLSegmentationNode: Fix unused-parameter segmentId warnings

This commit fixes these warnings:

/path/to/Slicer/Libs/MRML/Core/vtkMRMLSegmentationNode.cxx:265:58: warning: unused parameter ‘segmentId’ [-Wunused-parameter]
 void vtkMRMLSegmentationNode::OnSegmentAdded(const char* segmentId)
                                                          ^
/path/to/Slicer/Libs/MRML/Core/vtkMRMLSegmentationNode.cxx:270:60: warning: unused parameter ‘segmentId’ [-Wunused-parameter]
 void vtkMRMLSegmentationNode::OnSegmentRemoved(const char* segmentId)
                                                            ^
/path/to/Slicer/Libs/MRML/Core/vtkMRMLSegmentationNode.cxx:275:61: warning: unused parameter ‘segmentId’ [-Wunused-parameter]
 void vtkMRMLSegmentationNode::OnSegmentModified(const char* segmentId)
                                                             ^

Revision 25597  Directory Listing
Modified Thu Dec 8 21:24:28 2016 UTC (9 months, 2 weeks ago) by jcfr
STYLE: vtkSegmentation: Fix unused "targetRepresentationName" warning

Warning fixed is:

  /path/to/Slicer/Libs/vtkSegmentationCore/vtkSegmentation.cxx:957:63: warning: unused parameter ‘targetRepresentationName’ [-Wunused-parameter]
  bool vtkSegmentation::CreateRepresentation(const std::string& targetRepresentationName,
                                                               ^
Fixes #4305

Suggested-by: Csaba Pinter <csaba.pinter@queensu.ca>

Revision 25594  Directory Listing
Modified Thu Dec 8 20:44:29 2016 UTC (9 months, 2 weeks ago) by jcfr
STYLE: vtkSegmentationCore: Fix sign-compare warnings

This commit fixes warnings like these ones:

/path/to/Slicer/Libs/vtkSegmentationCore/vtkSegmentationHistory.cxx: In static member function ‘static void vtkSegmentationHistory::OnSegmentationModified(vtkObject*, long unsigned int, void*, void*)’:
/path/to/Slicer/Libs/vtkSegmentationCore/vtkSegmentationHistory.cxx:368:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (self->LastRestoredState != self->SegmentationStates.size())
                               ^

/path/to/Slicer/Libs/vtkSegmentationCore/vtkSegmentation.cxx: In member function ‘vtkSegment* vtkSegmentation::GetNthSegment(int) const’:
/path/to/Slicer/Libs/vtkSegmentationCore/vtkSegmentation.cxx:614:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (index < 0 || index >= this->SegmentIds.size())
                          ^

vtkOrientedImageDataResample.cxx: In instantiation of ‘void MergeImageGeneric2(vtkImageData*, vtkImageData*, int, const int*, int, double) [with BaseImageScalarType = double; ModifierImageScalarType = long long unsigned int]’:
/path/to/Slicer/Libs/vtkSegmentationCore/vtkOrientedImageDataResample.cxx:209:5:   required from ‘void MergeImageGeneric(vtkImageData*, vtkImageData*, int, const int*, int, double) [with BaseImageScalarType = double]’
/path/to/Slicer/Libs/vtkSegmentationCore/vtkOrientedImageDataResample.cxx:1032:5:   required from here
/path/to/Slicer/Libs/vtkSegmentationCore/vtkOrientedImageDataResample.cxx:176:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
           if (*modifierImagePtr > maskThreshold)
                                 ^

Revision 25591  Directory Listing
Modified Wed Dec 7 19:45:14 2016 UTC (9 months, 2 weeks ago) by lassoan
ENH: Added ViewGroup property to view nodes

ViewGroup is used for restricting scope of:
* linked slice view property changes (is slices are linked, a property change will only change views in the same group)
* crosshair jump to slice (if crosshair is moved with shift+mousemove and slice jump is enabled, only those slices will be moved that are in the same group as the view where the mouse was)
* slice intersection display (slice intersections will only shown of those slices that are in the same group)

Implementation:
* Added new ViewGroup member to abstract view node (string, empty by default)
* In default layouts "Three over three" and "Four over four" separated top/bottom rows (view IDs changed to Red+, Yellow+, Green+, 1+; unique node IDs were necessary because on layout change view group is not updated, so we cannot share view nodes between layouts the same group ID for all views)
* Updated vtkMRMLSliceNode::JumpAllSlices to only jump those slices that have matching viewgroup
* Updated vtkMRMLSliceLinkLogic::OnMRMLNodeModified(vtkMRMLNode* node) to make aware of groups
* Updated slice displayable manager to only show slice intersections in the same group (and mapped in layout)
* Updated 2D/3D displayable managers to only jump those slices on crosshair update (shift+mousemove) that are in the same group
* Updated GUI:
** Added View group view/edit to View Controllers module (Advanced section).
** Added viewGroup property to simple markups widget (that can restrict slice jumping to a specific view group)
* Added crosshair jump slice speed test to PerformanceTests module

Revision 25586  Directory Listing
Modified Mon Dec 5 18:41:40 2016 UTC (9 months, 2 weeks ago) by pinter
ENH: Add fractional labelmap conversion rules to segmentations

From: Kyle Sunderland <1krs1@queensu.ca>

Revision 25585  Directory Listing
Modified Fri Dec 2 20:33:46 2016 UTC (9 months, 3 weeks ago) by pinter
COMP: Fixed hastily committed code

Revision 25584  Directory Listing
Modified Fri Dec 2 20:17:50 2016 UTC (9 months, 3 weeks ago) by lassoan
ENH: Auto-select background/foreground volume for W/L change in slice viewer

If only foreground or background volume is selected then adjust the W/L of that.
If both foreground and background volumes are selected in a slice view:
* if foreground volume visibility is >0, and the user clicks on an area where the foreground volume is visible then the foreground volume's W/L is adjusted
* otherwise (e.g., user clicks outside the foreground volume) background volume's W/L is adjusted

This solves the frequent issue of users accidentally changing W/L of the invisible background volume (covered by foreground volume).
It also makes it easier to change W/L of foreground and background volumes (user doesn't need to swap the foreground/background volumes manually).

Revision 25583  Directory Listing
Modified Fri Dec 2 20:17:41 2016 UTC (9 months, 3 weeks ago) by lassoan
ENH: Added vtkMRMLSliceLogic::SetForegroundWindowLevel

Similar to existing vtkMRMLSliceLogic::SetBackgroundWindowLevel

Revision 25582  Directory Listing
Modified Fri Dec 2 20:08:18 2016 UTC (9 months, 3 weeks ago) by pinter
BUG: Fixed bug related to segment color update

Segment color did not update, if segmentation was loaded from the scene, and color was being changed twice or more.

Revision 25581  Directory Listing
Modified Fri Dec 2 16:20:15 2016 UTC (9 months, 3 weeks ago) by pinter
ENH: Color member in vtkSegment is now used as main color information

vtkSegment::Color (renamed from DefaultColor) holds the displayed color information instead of the Color member in SegmentDisplayProperties in segmentation display node.
Also Color member in SegmentDisplayProperties is now renamed to OverrideColor, and it is only used if different color is needed to be shown in different views, otherwise it is kept unset (default SEGMENT_COLOR_NO_OVERRIDE values)

Revision 25579  Directory Listing
Modified Mon Nov 28 19:57:42 2016 UTC (9 months, 3 weeks ago) by lassoan
ENH: Added access to labels and units in nrrd files

Standard nrrd fields, now exposed in vtkTeem.
These fields are needed for Sequences extension but can be useful for other modules, too.

Revision 25565  Directory Listing
Modified Tue Nov 22 06:03:30 2016 UTC (10 months ago) by lassoan
BUG: Fixed segmentation controller slice view widget

Segmentation state is correctly updated on scene close or when segmentation is deleted.
Visible segments list state is correctly displayed when adding/removing segments.

Revision 25557  Directory Listing
Modified Sat Nov 19 20:11:54 2016 UTC (10 months ago) by pinter
ENH: Terminology now uses code to identify entry

Instead of only using CodeMeaning, terminology logic now uses CodingSchemeDesignator and CodeValue to identify an entry. As a side effect, redundant members were removed and lookup became faster. Segments only contain one tag with the whole serialized terminology entry instead of 8 tags, and it does not contain recommended color any more. Terminology JSON files were changed so that capitalization is consistent across terminology dictionary files

Revision 25556  Directory Listing
Modified Sat Nov 19 13:16:52 2016 UTC (10 months ago) by lassoan
COMP: Fixed build error

Revision 25555  Directory Listing
Modified Sat Nov 19 12:55:40 2016 UTC (10 months ago) by lassoan
COMP: Fixed build error caused by transform logic relocation

Revision 25551  Directory Listing
Modified Fri Nov 18 18:44:48 2016 UTC (10 months ago) by lassoan
ENH: Allow display transform glyphs at markup positions

It is now possible to show where a markup point is transformed to using transform visualization.
Select "Glyph" visualization mode, open "Advanced" section and set "Source points".
Glyphs are updated in real-time as markups are moved, so this can be also used for probing the transformation
by drag-and-dropping markups in 2D and 3D views.

Transform logic needed access to Markups node, therefore module logic was moved to Modules/Loadable/Transforms/Logic.

Revision 25550  Directory Listing
Modified Fri Nov 18 07:56:26 2016 UTC (10 months, 1 week ago) by jcfr
STYLE: Fix spelling 'additonal' -> 'additional'

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25549  Directory Listing
Modified Fri Nov 18 07:14:53 2016 UTC (10 months, 1 week ago) by jcfr
STYLE: vtkSegmentationHistory: Fix typo in doxygen

Revision 25539  Directory Listing
Modified Thu Nov 17 14:27:31 2016 UTC (10 months, 1 week ago) by pinter
BUG: Fixed terminology color change bug

Fixes https://github.com/QIICR/Reporting/issues/76
Also fixed other minor bugs, such as tooltip update, layout warning message

Revision 25531  Directory Listing
Modified Sat Nov 12 22:39:10 2016 UTC (10 months, 1 week ago) by lassoan
BUG: Added null-pointer check to vtkThreeDViewInteractorStyle

If camera node or camera node scene is not set then leave event does not crash anymore.
Fixes test vtkMRMLThreeDReformatDisplayableManagerTest1.

Revision 25528  Directory Listing
Modified Sat Nov 12 08:04:28 2016 UTC (10 months, 1 week ago) by jcfr
BUG: Update qMRMLThreeDViewTest1 to account for new CrosshairDM

This is a follow up of r25521 (ENH: Improved crosshair usability,
added display in 3D view)

Revision 25522  Directory Listing
Modified Fri Nov 11 17:50:25 2016 UTC (10 months, 1 week ago) by pinter
BUG: Fixed segment opacity auto calculation

Revision 25521  Directory Listing
Modified Fri Nov 11 14:58:23 2016 UTC (10 months, 1 week ago) by lassoan
ENH: Improved crosshair usability, added display in 3D view

Crosshair had several problems/limitations:
1. Crosshair position was often inconsistent in different slice views (for example: when in navigation view, crosshair was always displayed in all slice views because otherwise the user could not drag the crosshair to a new position; but this way when the user changed slices then the crosshair showed different RAS positions in each slice view)
2. Navigation mode was very inconvenient: to jump all slices to a specific RAS position the user had to position the mouse to the previous crosshair and drag it to the new position (it was too easy to miss the small navigation area in the middle and when it was missed, brightness/contrast of the image was accidentally modified)
3. By default (if the user just toggled the crosshair button on the toolbar), crosshair was only visible in the current slice view, which was useless (the crosshair just followed the mouse in the current view)
4. Crosshair position was not visible in 3D view

Solution implemented:
1. Only show crosshair in the correct position in all views. If crosshair position is not in the current slice then hide the crosshair from current slice.
2. Crosshair is now moved by holding down shift + moving mouse. No need to grab the previous crosshair position. Navigation mode is replaced by "jump slices" option (enabled by default), which controls if slice views should jump to current crosshair position. If disabled then shift + moving mouse only moves the crosshair.
3. By default slices jump to current crosshair position, so crosshair is visible in all views. User just has to keep Shift key depressed (added hint to tooltip)
4. Implemented display of crosshair in 3D view.

Revision 25503  Directory Listing
Modified Sun Nov 6 01:16:55 2016 UTC (10 months, 2 weeks ago) by lassoan
ENH: Removed unnecessary warning in vtkMRMLSegmentationDisplayNode

Revision 25496  Directory Listing
Modified Wed Nov 2 19:06:29 2016 UTC (10 months, 3 weeks ago) by lassoan
ENH: Allow loading of regular 4D NRRD file as segmentation

Revision 25495  Directory Listing
Modified Wed Nov 2 19:06:26 2016 UTC (10 months, 3 weeks ago) by lassoan
BUG: Fixed segmentation default color intialization

Revision 25494  Directory Listing
Modified Wed Nov 2 19:06:21 2016 UTC (10 months, 3 weeks ago) by lassoan
ENH: Allow setting custom order for segments

Previously segments were alphabetically ordered based on segment ID, which often resulted in unexpected ordering and it was not possible to change segment order.

Revision 25490  Directory Listing
Modified Mon Oct 31 22:27:05 2016 UTC (10 months, 3 weeks ago) by lassoan
STYLE: Renamed vtkMRMLSegmentationDisplayNode method to be more accurate

Renamed GetAllSegmentIDs to GetSegmentIDs, as it does not always return all segment IDs.

Revision 25485  Directory Listing
Modified Fri Oct 28 21:13:30 2016 UTC (10 months, 3 weeks ago) by jcfr
BUG: Use Spline order for 3 template parameter.

This commit fixes common mistake of using dimension for spline order.  It
was discovered while working on a fix for #4290 (introduced after integrating
r25482 (ENH: Updating DCMTK to 3.6.1_2016.10.12).

Reviewed-by: Andras Lasso <lasso@queensu.ca>

From: Bradley Lowekamp <blowekamp@mail.nih.gov>

Revision 25482  Directory Listing
Modified Fri Oct 28 01:33:38 2016 UTC (10 months, 4 weeks ago) by jcfr
ENH: Updating DCMTK to 3.6.1_2016.10.12

Diff for DCMTK:
https://github.com/InsightSoftwareConsortium/DCMTK/compare/271f1e9731cfb29d9451b484ff50a39e32e2c90a...efe1a177eac040b6d41aae0db7714cd970e12bc5

A new version of ITK is required to compile Slicer with DCMTK updated:
https://github.com/Slicer/ITK/compare/16df9b689856cd4a8dd22a2cef92f5ee7222da0c...1168eba261e6a3c71c0372cc4cd833dd2d8fd693

A new version of CTK is required:
https://github.com/commontk/CTK/compare/afe8505a8286a701900fca1c97a4ad8876bbbe1a...d2b30cd1d525bd7f3856503373760921ea82dfde

A new version of BRAINSTools is required:
https://github.com/BRAINSia/BRAINSTools/compare/47dc8e66860be2bb074d17de18129978cb1ca93a...a5cfa21addf98d86da72f216d93e08913fa396d7

From: Francois Budin <francois.budin@gmail.com>

Revision 25481  Directory Listing
Modified Thu Oct 27 16:55:48 2016 UTC (10 months, 4 weeks ago) by johan.andruejol
BUG: Fix issue with qMRMLNodeComboBox when removing an attribute filter

Since QHash [] operator inserts a default-constructed value into the map
if the key is not found and because the [] operator was systematically
used, removing an attribute filter could lead the combobox to never show
anything.

The bug was as follow in pseudo-code:
 combobox = slicer.qMRMLComboBox()
 combobox.removeAttribute('vtkMRMLVolumeNode', 'MyAttribute')
-> Because of the [] operator, the map now has an entry for
'vtkMRMLVolumeNode' with nothing in it. It now expects nodes to have that
attribute declared (and it can have any value though).

The fix is to not use the [] operator when accessing values simply for
reading but to use the value() method instead.

Added a test along to make sure everything works properly.

Revision 25480  Directory Listing
Modified Wed Oct 26 16:20:58 2016 UTC (10 months, 4 weeks ago) by lassoan
BUG: Disable view node add/delete in camera module

View nodes are created by the layout manager automatically. Users should not manipulate them.

Fixed qMRMLDisplayNodeComboBox to not crash on scene close when there are orphan view nodes.

Revision 25460  Directory Listing
Modified Wed Oct 19 03:19:19 2016 UTC (11 months ago) by lassoan
BUG: Revert accidentally committed change

Revision 25459  Directory Listing
Modified Wed Oct 19 02:55:44 2016 UTC (11 months ago) by lassoan
BUG: Fixed vtkOrientedImageDataResample::TransformOrientedImageDataBounds

Revision 25458  Directory Listing
Modified Wed Oct 19 02:55:40 2016 UTC (11 months ago) by lassoan
ENH: Added OBJ file save option for model nodes

Revision 25457  Directory Listing
Modified Tue Oct 18 16:49:42 2016 UTC (11 months, 1 week ago) by lassoan
ENH: Changed label values in vtkMRMLSegmentationNode::GenerateMergedLabelmap

For label values generation use order of provided segment IDs instead of all segment IDs in the segmentation.
This is easier to use (as there is no need to look up the segment order in the original segmentation node)
and more flexible (order of label values can be chosen freely).

Revision 25453  Directory Listing
Modified Tue Oct 18 04:43:43 2016 UTC (11 months, 1 week ago) by lassoan
ENH: Cleaned up fast growcut algorithm implementation in segmentations logic

Revision 25450  Directory Listing
Modified Sat Oct 15 15:08:25 2016 UTC (11 months, 1 week ago) by lassoan
ENH: Made segment display node update more robust

Don't emit modified event when just updating internal cache to avoid reentrant updates in displayable managers.

Revision 25449  Directory Listing
Modified Sat Oct 15 15:08:21 2016 UTC (11 months, 1 week ago) by lassoan
PERF: Improved segment editor initialization speed

Revision 25448  Directory Listing
Modified Sat Oct 15 01:59:43 2016 UTC (11 months, 1 week ago) by lassoan
ENH: Create auto-complete effect from growcut and slice interpolation

The effect also has preview feature, so seeds or single-slice segmentation can be edited before result is finalized.

Revision 25447  Directory Listing
Modified Fri Oct 14 19:24:11 2016 UTC (11 months, 1 week ago) by pinter
ENH: Added Terminologies module for handling standard terminologies

Default terminology dictionaries are loaded on Slicer startup and can be used from Segmentations and Segment Editor to assign terminology entries to segments that appear in tooltips (later will take part in DICOMSeg export). Terminologies module also contains a qSlicerTerminologyNavigatorWidget that allows exploring terminologies.

-------------------------------------------------
ENH: Use CTK color picker in terminology selector

BUG: Fixed known bugs in terminology selector

BUG: Fixed minor bugs; Added custom color selection

ENH: Terminology selector dialog is used for segment color in segments table

Opacity delegate reverted back to qMRMLItemDelegate, as the slider shows up properly now (need to check on standard resolution screens)

ENH: Added terminology dialog, selector button, and delegate

The delegate needs to be set to the segment table (and other widgets that will use terminology) to be able to show and change terminology information. The delegate's editor is the new selector button that only shows the recommended color, but when clicked, shows the new selector dialog. The dialog is a simple wrapper dialog class for the navigator widget with select and cancel buttons.

ENH: Added anatomic region handling to terminology logic and navigator widget

ENH: Added terminology navigator widget and Json parsing logic

ENH: Load default terminology into Terminologies logic

Added two json files for the full SnoMed and its subset for the SlicerGeneralAnatomy entries. The SlicerGeneralAnatomy dictionary is loaded by default when calling the LoadDefaultTerminology function

ENH: Added Terminology module skeleton

Revision 25446  Directory Listing
Modified Fri Oct 14 16:48:19 2016 UTC (11 months, 1 week ago) by pinter
BUG: Removed color index tag from segments WIP

Using color indices was a heritage from when segmentations had a color table associated to them, and caused instability in labelmap export. It is needed to remove usage of color index tags from joint smoothing and grow cut, which will be done by @lassoan soon

Revision 25436  Directory Listing
Modified Wed Oct 12 18:34:54 2016 UTC (11 months, 1 week ago) by pinter
BUG: Slice view controller segmentation selector selects segmentation

It was quite confusing that even if there was a segmentation node in the scene, the selector in the slice view controllers showed None selection until the user changed it (note that the segmentation selector works differently than the volume selectors, as instead of setting there what to show on that layer, it can be used to change the visibility options of any segmentation, as multiple of those can be shown at the same time).
Addition of selectNodeUponCreation was not the change that fixed the issue, but still committing, because it may be useful later.

Revision 25428  Directory Listing
Modified Wed Oct 12 09:40:25 2016 UTC (11 months, 1 week ago) by jcfr
STYLE: Fix unused variable warning in vtkMRMLAbstractDisplayableManager

Revision 25424  Directory Listing
Modified Tue Oct 11 20:30:44 2016 UTC (11 months, 2 weeks ago) by pinter
BUG: Make sure the segment selector widget combobox is updated

The checkable combobox was not repainted unless it was the first segment whose visibility was changed, otherwise it was only updated on mouse hover. Now repaint is forced when selection is changed to make sure the changes are reflected in the checkable combobox.

Revision 25421  Directory Listing
Modified Tue Oct 11 18:09:25 2016 UTC (11 months, 2 weeks ago) by jcfr
ENH: Added OBJ file save option for model nodes

From: Andras Lasso <lasso@queensu.ca>

Revision 25412  Directory Listing
Modified Wed Oct 5 14:41:33 2016 UTC (11 months, 2 weeks ago) by lassoan
BUG: Fixed segment bounds computation

For images, bounds now contain voxel edges, not just voxel centerpoints.

Revision 25411  Directory Listing
Modified Tue Oct 4 21:26:27 2016 UTC (11 months, 3 weeks ago) by lassoan
ENH: Added contour interpolation

Available in smoothing effect, smoothing method: Interpolation.

Using algorithm:
ND morphological contour interpolation
http://insight-journal.org/browse/publication/977

Revision 25408  Directory Listing
Modified Tue Oct 4 17:45:14 2016 UTC (11 months, 3 weeks ago) by jcfr
COMP: remove tractography-related parts of vtkTeem

Build as part of SlicerDMRI extension:
https://github.com/SlicerDMRI/SlicerDMRI

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25403  Directory Listing
Modified Thu Sep 29 20:36:15 2016 UTC (11 months, 3 weeks ago) by lassoan
BUG: Fixed cropping issue when combining segments with different geometry

Revision 25399  Directory Listing
Modified Wed Sep 28 01:52:23 2016 UTC (11 months, 3 weeks ago) by lassoan
ENH: Improved segment editor usability

* Segment renames are consistently included in undo/redo history
* Increased default size of undo stack to 10
* Current effect remains active if segments are added or removed
* Segment selection is maintained when selecting a non-per-segment effect
* Select to next segment when removing a segment (instead of select first)

Revision 25397  Directory Listing
Modified Tue Sep 27 01:45:16 2016 UTC (11 months, 4 weeks ago) by pinter
BUG: Fix appearance of segmentation representation list view on high resolution displays

Revision 25394  Directory Listing
Modified Mon Sep 26 13:23:19 2016 UTC (11 months, 4 weeks ago) by msmolens
BUG: Force image slice actors to be treated as opaque

This commit fixes rendering of image slices in the 3D view with the VTK
OpenGL2 backend.

The OpenGL2 backend performs more thorough checks than the old backend
when determining whether to treat an actor as opaque or translucent.
Now, in certain cases, VTK determines that the slice texture contains
transparent elements and therefore should treat the actor as
translucent, i.e. rendered without writing to the depth buffer. [1][2]

This commit overrides that transparency-detection logic to force the
image slice actors to be treated as opaque.

Fixes http://www.na-mic.org/Bug/view.php?id=4253

[1] https://github.com/Kitware/VTK/blob/bace0bcf81dd6e8d334b78add2d77da37d71398f/Rendering/Core/vtkActor.cxx#L131-L133

[2] https://github.com/Kitware/VTK/blob/bace0bcf81dd6e8d334b78add2d77da37d71398f/Rendering/OpenGL2/vtkOpenGLActor.cxx#L59

Revision 25393  Directory Listing
Modified Mon Sep 26 02:53:44 2016 UTC (11 months, 4 weeks ago) by lassoan
BUG: Improved robustness of segmentations in sequences

Segment selections are properly updated now when browsing a segmentation sequence.
Crash in segmentation displayable manager solved (when number of segments was different in segmentations in the same sequence).

Revision 25389  Directory Listing
Modified Thu Sep 22 21:15:02 2016 UTC (12 months ago) by lassoan
ENH: Made vtkMRMLStorageNode::GetFileNameWithoutExtension more convenient

It strips known file extensions, which simplifies its usage (no need for three separate steps of
getting the filename, getting known extension, and then removing the known extension).

Also cleaned up a workaround that was introduced to quickly fix this issue:
http://www.na-mic.org/Bug/view.php?id=3991

Revision 25388  Directory Listing
Modified Thu Sep 22 21:14:58 2016 UTC (12 months ago) by lassoan
ENH: Allow changing segmentation object inside segmentation node

Important for using segmentations in sequence nodes.

Revision 25387  Directory Listing
Modified Thu Sep 22 21:14:54 2016 UTC (12 months ago) by lassoan
PERF: Improved node reference copy performance

Only remove and re-add node references if they are not the same in the current and source node.

Revision 25386  Directory Listing
Modified Thu Sep 22 21:14:50 2016 UTC (12 months ago) by lassoan
PERF: Improve model update performance

Model module's widget computed model surface, volume, etc. every time the model changed, even when the module info section was not visible.
This cause a significant overhead when replaying changing models using Sequences module.
Applied a similar technique as for transforms info: only compute model properties when the window content is actually visible.

Revision 25384  Directory Listing
Modified Thu Sep 22 19:22:17 2016 UTC (12 months ago) by pinter
STYLE: Added doxygen description to vtkSegmentation and vtkSegment

Revision 25379  Directory Listing
Modified Tue Sep 20 21:31:37 2016 UTC (12 months ago) by pinter
ENH: Added data probe support for segmentations

Now any displayable manager can supply information to the data probe if the GetDataProbeInfoStringForPosition virtual method is overridden.

Also poly data fill for segmentation 2D display was fixed. It was disabled due to being unstable, see https://app.assembla.com/spaces/slicerrt/tickets/809-segmentation-polydata-2d-fill-visualization-not-stable
The error was a very obscure one: it turns out the first argument of vtkCellArray::GetCell is not the index, but a special locator position, which fact should be emphasized in the documentation at least.

Revision 25370  Directory Listing
Modified Tue Sep 20 00:55:40 2016 UTC (12 months ago) by lassoan
ENH: Added null-pointer checks to segmentation widgets

Also improved API documentation and event observations.

Revision 25369  Directory Listing
Modified Mon Sep 19 21:03:18 2016 UTC (12 months ago) by pinter
BUG: Changed segmentation combobox behaviour in slice controller

The segmentation combobox in the slice view controllers showed any hidden segmentation that was selected (thus the eye icon seemed not to be updated). This is now turned off, so changing selection itself does not change segmentation visibility. Also the None item in the combobox is now removed, as it was related to the above function.

Failing segmentation test has also been fixed.

Revision 25367  Directory Listing
Modified Fri Sep 16 19:59:47 2016 UTC (12 months, 1 week ago) by pinter
ENH: Added segment selector combobox to slice view controller

A fourth row is added to slice view controller which is only visible if a segmentation node is present in the scene. It behaves differently than the other rows in the sense that it does not assign the selected node to a role that is specific to the slice view, but allows changing display properties of a segmentation that are global (visibility, opacity, segment visibility, outline/fill). Selecting a segmentation shows it if hidden.

ENH: Added multi-selection option to segment selector widget

ENH: Removed legacy labelmap support

Segmentation node is no longer subclass of labelmap volume node. Temporary color table is removed (color index tag remained, consecutive values are assigned). Utility function ShiftImageDataExtentToZeroStart moved to volume node from segmentation node, may come in handy

Revision 25365  Directory Listing
Modified Thu Sep 15 04:23:06 2016 UTC (12 months, 1 week ago) by lassoan
BUG: Fixed reading of bspline transforms

Bspline transforms were interpreted as inverse bspline transforms because of an incorrect
transform class type check in vtkITKTransformConverter::SetVTKBSplineParametersFromITKGeneric.
The safest way of checking of class type would be dynamic_cast, but for now only matching of GetNameOfClass() is tested.

This fixes issue (Could not create an instance of "InverseBSplineTransform_double_3_3") that occurred
when trying to use a bspline transform computed by a CLI in another CLI.

Revision 25363  Directory Listing
Modified Wed Sep 14 15:52:15 2016 UTC (12 months, 1 week ago) by pinter
ENH: Make use of node combobox editing option from slice views

The nodeAboutToBeEdited signal was so far not used within Slicer core, however it was defined. This commit does not actually enable node editing in the slice view controllers, only allows it to happen later.

Revision 25360  Directory Listing
Modified Wed Sep 14 03:12:37 2016 UTC (12 months, 1 week ago) by lassoan
ENH: Improved data file format helper tests

Revision 25359  Directory Listing
Modified Wed Sep 14 03:12:33 2016 UTC (12 months, 1 week ago) by lassoan
ENH: fix vtkDataFileFormatHelper to support simple ext defs

Revision 25358  Directory Listing
Modified Wed Sep 14 03:12:29 2016 UTC (12 months, 1 week ago) by lassoan
ENH: Update filetype format init for recent changes

ref cfdf8cc590450e5bcbe13b75c9cc6a9b5019883e
and https://github.com/Slicer/Slicer/commit/cfdf8cc590450e5bcbe13b75c9cc6a9b5019883e#commitcomment-18997559

Revision 25355  Directory Listing
Modified Tue Sep 13 20:47:14 2016 UTC (12 months, 1 week ago) by lassoan
BUG: Fixed logic in vtkMRMLStorageNode::GetSupportedReadFileTypes

"All files" was added to list of SupportedReadFileTypes every time, while it is only necessary when
a storage node does not specify any supported read file type.

Revision 25354  Directory Listing
Modified Tue Sep 13 18:44:07 2016 UTC (12 months, 1 week ago) by pinter
BUG: Fixed undeterministic behaviour of segment SH removal

When the subject hierarchy node of a segment was removed, then it depended on the order of the onNodeAboutToBeRemoved function calls whether removal of the virtual segmentation branch containing the segment subject hierarchy nodes was successful. This change fixes this problem by using a similar logic as in data module logic that is responsible for removing the associated display and storage nodes for a removed node.

Revision 25344  Directory Listing
Modified Fri Sep 9 19:11:32 2016 UTC (12 months, 2 weeks ago) by lassoan
BUG: Made segmentation conversion to surface more robust

Segments did not appear in 3D that have labelmap with label value != 1.
Now the maximum scalar value is used as label value.

Revision 25343  Directory Listing
Modified Fri Sep 9 19:11:29 2016 UTC (12 months, 2 weeks ago) by lassoan
ENH: Improved speed of labelmap to segmentation conversion

Revision 25342  Directory Listing
Modified Fri Sep 9 19:11:25 2016 UTC (12 months, 2 weeks ago) by lassoan
ENH: Allow computation of surface normals for segmentation display

Slightly increases computation time but improves display quality.

Revision 25341  Directory Listing
Modified Fri Sep 9 19:11:19 2016 UTC (12 months, 2 weeks ago) by lassoan
PERF: Improved vtkMRMLDisplayNode::GetDisplayableNode speed

Last found value is cached. It makes finding of displayable nodes much faster in large scenes.

Revision 25338  Directory Listing
Modified Thu Sep 8 21:05:03 2016 UTC (12 months, 2 weeks ago) by pinter
ENH: Improved segmentation display options

Segmentation display settings now in a reusable widget qMRMLSegmentationDisplayNodeWidget. Displayed representations, slice intersection thickness, and views moved into Advanced section. Special display options (slice outline, slice fill and 3D visibility and opacity) for the whole segmentation also added there. Instead of the special display settings on long-click in the segments table they now can be set using similar checkboxes/sliders as for the whole segmentation. These set the settings for the segment that is selected in the segments table.

Revision 25333  Directory Listing
Modified Thu Sep 8 16:23:02 2016 UTC (12 months, 2 weeks ago) by msmolens
COMP: Convert to vtkMTimeType for modified times to fix compile errors

https://gitlab.kitware.com/vtk/vtk/merge_requests/1790 ("ENH: Introduce
vtkMTimeType") adds vtkMTimeType as a typedef for vtkObject modified times,
replacing unsigned long. This commit updates Slicer to use the new type. This
fixes compile errors like:

    c:\path\to\slicer\libs\vtkteem\vtkDiffusionTensorGlyph.h(192): error C2555: 'vtkDiffusionTensorGlyph::GetMTime': overriding virtual function return type differs and is not covariant from 'vtkObject::GetMTime'

Revision 25328  Directory Listing
Modified Thu Sep 1 04:16:59 2016 UTC (12 months, 3 weeks ago) by lassoan
STYLE: Replaced (someStdString == std::string("")) by (someStdString.empty())

They are functionally equivalent, but .empty() is shorter and simpler.

Revision 25326  Directory Listing
Modified Wed Aug 31 15:30:03 2016 UTC (12 months, 3 weeks ago) by lassoan
BUG: Fixed initialization of segmentation SH nodes

If a scene was saved without subject hierarchy (SH) nodes and then loaded into a Slicer app where automatic SH node creation is enabled,
SH nodes are now properly created for all segments.

Removed unnecessary warnings during scene load.

Revision 25323  Directory Listing
Modified Wed Aug 31 15:29:51 2016 UTC (12 months, 3 weeks ago) by lassoan
ENH: Improved node saving and loading

This commit contains two changes, which might have been delivered as two separate commits, but they have been implemented at the same time
and modify the same files, therefore splitting them would be not easy.

1. Storable node can decide what is the most appropriate storage node, based on the requested file name and storable node content.

Implemented by adding vtkMRMLStorableNode::AddDefaultStorageNode, which creates most appropriate storage node class and adds it to the scene
(similarly to vtkMRMLDisplayableNode::CreateDisplayNodes()). Also added vtkMRMLStorableNode::GetDefaultStorageNodeClassName(), which allows
creating the right type of storage node depending on target filename and storable node content.

Now there is no more need for the model storage node "special case" in vtkSlicerApplicationLogic::ProcessReadNodeData.

Now current scene's CreateNodeInstance method can be used for storage node creation. The scene may contain customized default storage nodes
(e.g., storage node that uses a customized file extension or compression option), which are now taken into account.
For example, changing default model node saving extension can be achieved by this:

msn=slicer.vtkMRMLModelStorageNode()
msn.SetDefaultWriteFileExtension('stl')
slicer.mrmlScene.AddDefaultNode(msn)

Default nodes can be created from information stored in the application settings, so this allows
specifying default file saving format in the application settings (this is how default view options are configured already).

Having a method for creating and adding storage node as needed also simplifies vtkSlicerFiducialsLogic::AddFiducialList,
vtkMRMLColorNode::ReadXMLAttributes, vtkMRMLSceneViewNode::ReadXMLAttributes, vtkMRMLApplicationLogic::SaveSceneToSlicerDataBundleDirectory, etc.

2. Improved composite file extension support (.nii.gz, .seg.nrrd, ...)

Suitable file reader list in "Add data dialog" is populated using the most specific matched extension's reader.
For example, .nrrd is more specific than .*; .seg.nrrd is more specific than .nrrd. This allows correct deafult
selection. This allowed removing workarounds and special cases added for composite image file extensions (such as .nii.gz)
and .* wildcard. It also allows proper default selection for segmentation nodes (.seg.nrrd).
In the future, it could be used for removing workarounds added for guessing labelmaps, annotation ROI nodes, etc
(labelmap volumes could use .label.nrrd, annotation nodes could use something.roi.csv something.fid.csv, ... instead of
using ambiguous and/or non-standard file extensions such as .acsv or .fcsv).

Made file extension matching more robust: instead of using heuristics, such as assuming .gz means a composite file extension
and collecting all possible extension from all storage nodes; now extensions are verified/matched/removed by the specific
storage node that is responsible for reading/writing the node.

Revision 25322  Directory Listing
Modified Wed Aug 31 15:29:42 2016 UTC (12 months, 3 weeks ago) by lassoan
BUG: Fixed segmentation GetModifiedSinceRead logic

Instead of trying to figure out modification by checking timestamps, update storage modified time whenever contents is changed
(content modified events are already observed anyway).

Also moved registration of Segmentation nodes into vtkMRMLScene - as it is done for all other MRML nodes stored in Libs/MRML/Core.

Revision 25321  Directory Listing
Modified Wed Aug 31 15:29:32 2016 UTC (12 months, 3 weeks ago) by lassoan
ENH: Allow overriding deafult write file extension in storage nodes

Instead of hardcoding DefaultWriteFileExtension string, it is now stored in a member variable.

Revision 25318  Directory Listing
Modified Mon Aug 29 23:02:51 2016 UTC (12 months, 3 weeks ago) by jcfr
BUG: Fix vtkMRMLNonlinearTransformNodeTest1

This commit fixes the reading of ITKv3 transforms by addressing
a regression introduced in r24875 (BUG: Fix transform tests by not
using dynamic_cast in vtkITKTransformConverter)

It basically ensures that executable created using compiler (e.g g++4.4.3)
[not supporting the use of dynamic_cast with templated classes instantiated
in a translation unit different than the one where they are defined] still
work as expected.

See #4139

Revision 25313  Directory Listing
Modified Thu Aug 25 21:53:50 2016 UTC (13 months ago) by lassoan
ENH: Improve compatibility of Segmentations saved in nrrd file

Extent of images stored in NRRD files always start from (0,0,0).
To be able to save/restore arbitrary extents, a private field (Segmentation_Extent) was used.
However, external software packages that ignored this private field did not display the segments in correct position.

The space origin is now set so that if the private Segmentation_ReferenceImageExtentOffset field is ignored, the segments
still appear in correct physical position. If Slicer reads the segmentation, it restores the extent by setting the extent
start to Segmentation_ReferenceImageExtentOffset and shifting back the image origin to the original position.

Revision 25310  Directory Listing
Modified Wed Aug 24 14:46:33 2016 UTC (13 months ago) by lassoan
BUG: Fixed surface representation update for empty segments

When a labelmap master representation was cleared, the polydata representation was not updated
(conversion reported to be failed). An empty labelmap is a valid input, changed behavior to
produce an empty polydata.

Revision 25307  Directory Listing
Modified Wed Aug 24 03:58:20 2016 UTC (13 months ago) by lassoan
BUG: Fixed vtkSegmentationHistory::SetMaximumNumberOfStates

Revision 25306  Directory Listing
Modified Wed Aug 24 03:06:32 2016 UTC (13 months ago) by lassoan
ENH: Reduced false alarm warnings in segmentation tests

Revision 25304  Directory Listing
Modified Tue Aug 23 21:46:50 2016 UTC (13 months ago) by lassoan
ENH: Finished implementing undo/redo for Segment Editor

Undo/redo is now enabled by default.

Fixed modification event management for segmentation nodes. Displayable managers now observe segmentation node changes (there is no need for direct display refresh trigger from segmentation node).
Fixed restoring of segment colors from .seg.nrrd files.

Improved segment editor update speed:
1. Only those representations will be re-generated where the master representation actually changed (e.g., if an empty part of a segment is "cleared" as a result of an editing operation, it no longer triggers a refresh on dependent representations)
2. During saving undo state, those representations that has not changed compared to the last saved state are only shallow-copied from the previous saved state.

Revision 25302  Directory Listing
Modified Sat Aug 20 12:59:36 2016 UTC (13 months ago) by lassoan
ENH: Implemented undo/redo in Segment Editor

The implementation is not yet optimized for speed and memory consumption (all segments are copied, not just those that are modified; states are stored uncompressed),
so undo/redo is disabled by default (can be enabled in modules that have an embedded editor by calling editorWidget.setUndoEnabled(True)).

Revision 25297  Directory Listing
Modified Wed Aug 17 18:02:12 2016 UTC (13 months, 1 week ago) by lassoan
ENH: Added "joint" option to segment editor smoothing effect

Uses the same approach as model maker (creates a combined mesh, smoothes that, then extracts each segment's mesh) and then converts the result back to binary image.

Also fixed restoring of segment editor effect parameters from saved scene.

Revision 25291  Directory Listing
Modified Tue Aug 16 18:01:20 2016 UTC (13 months, 1 week ago) by jcfr
STYLE: Remove unused loadable ModelMirror and ModelTransform logics

Suggested-by: Csaba Pinter <csaba.pinter@queensu.ca>

Revision 25290  Directory Listing
Modified Tue Aug 16 16:41:52 2016 UTC (13 months, 1 week ago) by lassoan
BUG: Fixed problems in segmentation master repr switch

Store master representation in std::string instead of char*. It makes code simpler and safer (NULL-pointer check for char* was missing at many places).
Don't reset or change master representation in vtkSegmentation. When switching or changes is useful for user's convenience, it is done in GUI and logic classes.
Fixed bugs of deleting closed surface representation in Segment Editor module when that was the master representation.
Made temporary master representation observation disabling more robust (now the previous state is restored instead of always enabling after it was temporarily disabled).
Changed a few warning messages to debug message (it may be normal to have empty segments).

Revision 25281  Directory Listing
Modified Fri Aug 12 16:25:55 2016 UTC (13 months, 1 week ago) by lassoan
BUG: Fixed memory leak in Segmentation Editor

When Segmentation node was created in Segmentation Editor, an extra reference was kept to it.

Revision 25270  Directory Listing
Modified Wed Aug 10 19:36:52 2016 UTC (13 months, 2 weeks ago) by lassoan
ENH: Switch to windowed sinc smoothing in segment surface converter

It better maintains object size (there is less shrinking).

Revision 25267  Directory Listing
Modified Tue Aug 9 01:03:12 2016 UTC (13 months, 2 weeks ago) by lassoan
ENH: Fixed warning when slice intersection display enabled for empty polydata

When a new model node was created (or polydata was reset in an existing model node) and model slice intersection display was enabled then VTK logged a lot of warnings. It is a normal use case to have empty model node, so no warnings should be logged.

Added a check so that now if the polydata is NULL or does not contain any points then the model slice intersection actor visibility is turned off.

How to reproduce:

---
p = vtk.vtkPolyData()
mn = slicer.vtkMRMLModelNode()
mn.SetAndObservePolyData(p)
slicer.mrmlScene.AddNode(mn)
mn.CreateDefaultDisplayNodes()
mn.GetDisplayNode().SetSliceIntersectionVisibility(1)
---

Prints into the log:

No input data

No input data

No input data

No input data

No input data

No input data

Revision 25262  Directory Listing
Modified Thu Aug 4 01:17:22 2016 UTC (13 months, 3 weeks ago) by lassoan
BUG: Fixed crash in vtkMRMLScene

vtkMRMLScene::GenerateUniqueName and vtkMRMLScene::GetUniqueNameByString crashed on invalid input.

Revision 25246  Directory Listing
Modified Tue Jul 26 02:20:46 2016 UTC (14 months ago) by lassoan
ENH: Added vtkMatrix4x4 string conversion methods (#554)

Contributed by Matthew S Holden (PerkLab, Queen's)

Revision 25239  Directory Listing
Modified Tue Jul 19 13:02:17 2016 UTC (14 months, 1 week ago) by msmolens
BUG: Fix OpenGL errors/segfault when entering volume rendering module

The following workflow triggered OpenGL errors (when using the VTK OpenGL
backend) followed by a segfault (when using the VTK OpenGL2 backend):

1. Set 3D-only layout, restart app
2. Load volume
3. Enter the volume rendering module

For the OpenGL2 backend, the top of the stack trace is similar to the following:

 	vtkOpenGL-7.1.dll!vtkShaderProgram::IsUniformUsed(const char * cname) Line 847	C++
 	vtkOpenGL-7.1.dll!vtkOpenGLPolyDataMapper2D::SetMapperShaderParameters(vtkOpenGLHelper & cellBO, vtkViewport * viewport, vtkActor2D * actor) Line 409	C++
 	vtkOpenGL-7.1.dll!vtkOpenGLPolyDataMapper2D::UpdateShaders(vtkOpenGLHelper & cellBO, vtkViewport * viewport, vtkActor2D * actor) Line 325	C++
 	vtkOpenGL-7.1.dll!vtkOpenGLPolyDataMapper2D::RenderOverlay(vtkViewport * viewport, vtkActor2D * actor) Line 874	C++
 	vtkRendering-7.1.dll!vtkActor2D::RenderOverlay(vtkViewport * viewport) Line 125	C++
 	vtkRendering-7.1.dll!vtkRenderer::PickGeometry() Line 1810	C++
 	vtkOpenGL-7.1.dll!vtkOpenGLRenderer::DevicePickRender() Line 602	C++
 	vtkRendering-7.1.dll!vtkRenderer::PickRender(vtkPropCollection * props) Line 1735	C++
 	vtkRendering-7.1.dll!vtkRenderer::PickProp(double selectionX1, double selectionY1, double selectionX2, double selectionY2) Line 1559	C++
 	vtkRendering-7.1.dll!vtkRenderer::PickProp(double selectionX, double selectionY) Line 432	C++
 	vtkRendering-7.1.dll!vtkViewport::PickPropFrom(double selectionX, double selectionY, vtkPropCollection * pickfrom) Line 721	C++
 	vtkRendering-7.1.dll!vtkPropPicker::PickProp(double selectionX, double selectionY, vtkRenderer * renderer) Line 87	C++
 	vtkRendering-7.1.dll!vtkPropPicker::PickProp(double selectionX, double selectionY, vtkRenderer * renderer, vtkPropCollection * pickfrom) Line 63	C++
 	vtkRendering-7.1.dll!vtkPropPicker::Pick(double selectionX, double selectionY, double __formal, vtkRenderer * renderer) Line 49	C++
 	vtkSlicerAnnotationsModuleVTKWidgets.dll!vtkAnnotationROIRepresentation2D::ComputeInteractionState(int X, int Y, int __formal) Line 644	C++
 	vtkInteraction-7.1.dll!vtkAbstractWidget::SetEnabled(int enabling) Line 155	C++
 	vtkRendering-7.1.dll!vtkInteractorObserver::On() Line 73	C++
 	vtkSlicerAnnotationsModuleMRMLDisplayableManager.dll!vtkMRMLAnnotationROIDisplayableManager::CreateWidget(vtkMRMLAnnotationNode * node) Line 192	C++
 	vtkSlicerAnnotationsModuleMRMLDisplayableManager.dll!vtkMRMLAnnotationDisplayableManager::AddAnnotation(vtkMRMLAnnotationNode * annotationNode) Line 2166	C++
 	vtkSlicerAnnotationsModuleMRMLDisplayableManager.dll!vtkMRMLAnnotationDisplayableManager::OnMRMLSceneNodeAdded(vtkMRMLNode * node) Line 464	C++
 	MRMLLogic.dll!vtkMRMLAbstractLogic::ProcessMRMLSceneEvents(vtkObject * caller, unsigned long event, void * callData) Line 476	C++
 	MRMLLogic.dll!vtkMRMLAbstractLogic::MRMLSceneCallback(vtkObject * caller, unsigned long eid, void * clientData, void * callData) Line 173	C++
 	vtkCommon-7.1.dll!vtkCallbackCommand::Execute(vtkObject * caller, unsigned long event, void * callData) Line 43	C++
 	MRMLCore.dll!vtkEventBroker::InvokeObservation(vtkObservation * observation, unsigned long eid, void * callData) Line 842	C++
 	MRMLCore.dll!vtkEventBroker::ProcessEvent(vtkObservation * observation, vtkObject * caller, unsigned long eid, void * callData) Line 687	C++
 	MRMLCore.dll!vtkEventBroker::Callback(vtkObject * caller, unsigned long eid, void * clientData, void * callData) Line 914	C++
 	vtkCommon-7.1.dll!vtkCallbackCommand::Execute(vtkObject * caller, unsigned long event, void * callData) Line 43	C++
 	vtkCommon-7.1.dll!vtkSubjectHelper::InvokeEvent(unsigned long event, void * callData, vtkObject * self) Line 619	C++
 	vtkCommon-7.1.dll!vtkObject::InvokeEvent(unsigned long event, void * callData) Line 785	C++
 	MRMLCore.dll!vtkMRMLScene::AddNode(vtkMRMLNode * n) Line 1241	C++
 	vtkSlicerAnnotationsModuleMRML.dll!vtkMRMLAnnotationNode::Initialize(vtkMRMLScene * mrmlScene) Line 668	C++
 	vtkSlicerAnnotationsModuleMRML.dll!vtkMRMLAnnotationControlPointsNode::Initialize(vtkMRMLScene * mrmlScene) Line 702	C++
 	vtkSlicerAnnotationsModuleMRML.dll!vtkMRMLAnnotationLinesNode::Initialize(vtkMRMLScene * mrmlScene) Line 570	C++
 	vtkSlicerAnnotationsModuleMRML.dll!vtkMRMLAnnotationROINode::Initialize(vtkMRMLScene * mrmlScene) Line 47	C++
 	vtkSlicerVolumeRenderingModuleLogic.dll!vtkSlicerVolumeRenderingLogic::UpdateDisplayNodeFromVolumeNode(vtkMRMLVolumeRenderingDisplayNode * displayNode, vtkMRMLVolumeNode * volumeNode, vtkMRMLVolumePropertyNode * * propNode, vtkMRMLAnnotationROINode * * roiNode) Line 939	C++
 	qSlicerVolumeRenderingModuleWidgets.dll!qSlicerVolumeRenderingModuleWidgetPrivate::createVolumeRenderingDisplayNode(vtkMRMLVolumeNode * volumeNode) Line 249	C++
 	qSlicerVolumeRenderingModuleWidgets.dll!qSlicerVolumeRenderingModuleWidget::onCurrentMRMLVolumeNodeChanged(vtkMRMLNode * node) Line 346	C++
	...

The errors/segfault occur when hardware picking is performed before the render
window has created an OpenGL context. Usually render windows create a context on
their first render, but that doesn't happen in this case because the slice views
aren't visible; see [1].

This commit fixes the problem by forcing an initial render when creating a slice
view. This ensures that the render window has a context, which in turn prevents
the OpenGL errors/segfault in the above workflow, and possibly others.

[1] https://github.com/commontk/CTK/blob/bacd360/Libs/Visualization/VTK/Widgets/ctkVTKAbstractView.cpp#L229-L233.

Revision 25227  Directory Listing
Modified Fri Jul 8 17:53:42 2016 UTC (14 months, 2 weeks ago) by msmolens
BUG: Fix vtkMRMLThreeDReformatDisplayableManagerTest1

This commit fixes an image diff failure in
vtkMRMLThreeDReformatDisplayableManagerTest1. In VTK 7, to retain the same
behavior as when using VTK 6, it is necessary to specify valid default bounds
when initializing vtkImplicitPlaneRepresentation.

Revision 25224  Directory Listing
Modified Fri Jul 8 17:53:37 2016 UTC (14 months, 2 weeks ago) by msmolens
COMP: Update excluding segmentation-related methods for wrapping

VTK deprecated the BTX/ETX markers, and therefore wrapping code in the markers
no longer excludes the code from being wrapped. Since wrapping fails on these
lines, exclude them using the preprocessor macro defined during wrapping.

This resolves errors such as the following:

    vtkWrapPython-7.1: In /path/to/Slicer-build/Libs/vtkSegmentationCore/vtkSegmentation.h:122: syntax is ambiguous.

See https://github.com/Kitware/VTK/commit/55878a2.

Revision 25223  Directory Listing
Modified Fri Jul 8 17:53:35 2016 UTC (14 months, 2 weeks ago) by msmolens
COMP: Update excluding singleton intializers for wrapping

VTK deprecated the BTX/ETX markers, and therefore wrapping code in the markers
no longer excludes the code from being wrapped. Since wrapping fails on these
lines, exclude them using the preprocessor macro defined during wrapping.

See https://github.com/Kitware/VTK/commit/55878a2.

Revision 25221  Directory Listing
Modified Fri Jul 8 17:53:31 2016 UTC (14 months, 2 weeks ago) by msmolens
COMP: Update usage of deprecated SetUpdateExtent methods

VTK has deprecated SetUpdateExtent methods on vtkAlgorithm, such as
SetUpdateExtent() and SetUpdateExtentToWholeExtent(). Update code that uses the
deprecated methods.

See https://github.com/Kitware/VTK/commit/f020ebb.

Co-authored-by: Adam Rankin <arankin@robarts.ca>
Co-authored-by: Max Smolens <max.smolens@kitware.com>

Revision 25220  Directory Listing
Modified Fri Jul 8 17:53:29 2016 UTC (14 months, 2 weeks ago) by msmolens
COMP: Update usage of deprecated vtkDataArrayTemplate

VTK has deprecated vtkDataArrayTemplate in favor of vtkAOSDataArrayTemplate. As
part of that change, several vtkDataArrayTemplate methods were deprecated and
replaced.

This commit updates references to vtkDataArrayTemplate and replaces calls to the
following deprecated methods as indicated:

- GetTupleValue (old) to GetTypedTuple (new)
- SetTupleValue (old) to SetTypedTuple (new)

See https://github.com/Kitware/VTK/commit/06e98d0 and
https://github.com/Kitware/VTK/commit/893fb6e.

Co-authored-by: Adam Rankin <arankin@robarts.ca>
Co-authored-by: Max Smolens <max.smolens@kitware.com>

Revision 25208  Directory Listing
Modified Wed Jul 6 05:42:00 2016 UTC (14 months, 2 weeks ago) by jcfr
BUG: qMRMLThreeDViewControllerWidget: Fix axes labels

This fixes a regression introduced in r25161 (Set ctkAxesWidget labels
from view node) that caused the axis labels to be swapped.

From: Davide Punzo <punzodavide@hotmail.it>

Revision 25206  Directory Listing
Modified Wed Jul 6 01:29:30 2016 UTC (14 months, 2 weeks ago) by jcfr
ENH: Add new segmentations infrastructure

This commit integrates the segmentations infrastructure that has been
incubated in the SlicerRT project. It is a new paradigm for handling
segmentations, see slides [1] to understand the underlying concepts.

[1] https://www.slicer.org/slicerWiki/index.php/File:20160526_Segmentations.pptx

More specifically, it adds:

* vtkSegmentationCore library (only depends on VTK)

* Segmentations loadable module including:
  - EditorEffects
  - Logic
  - MRML
  - MRML displayable manager
  - Widgets

* Segment editor scripted module

Co-authored-by:
  Andras Lasso <lasso@queensu.ca>
  Adam Rankin <arankin@robarts.ca> (initial implementation round for segmentation MRML and containers)
  Kyle Sunderland <1krs1@queensu.ca> (developed vtkPlanarContourToClosedSurfaceConversionRule)
  Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>  (build infrastructure and compilation warning fixes)

From: Csaba Pinter <csaba.pinter@queensu.ca>

Revision 25199  Directory Listing
Modified Sun Jun 19 05:57:13 2016 UTC (15 months, 1 week ago) by lassoan
BUG: Removed crashing vtkMRMLSliceNode::SetSliceToRAS method

Using vtkCxxSetObjectMacro on a vtkSmartPointer-based variable always crashes. There was an option to either change SliceToRAS to a simple pointer and still allow users to set the pointer from outside, but object ownership would not have been very clear, several NULL-pointer checks should have been included; and already ->GetSliceToRAS()->DeepCopy(...) us used in Slicer core to modify the variable everywhere in the Slicer core and it is better not to have different mechanisms for the same purpose.

Revision 25195  Directory Listing
Modified Thu Jun 16 22:54:59 2016 UTC (15 months, 1 week ago) by jcfr
BUG: vtkMRMLSliceLogic: Correct slice offset when fit to volume is called.

Fixes #3350

From: Thomas Greer <hastings.greer@kitware.com>

Revision 25194  Directory Listing
Modified Thu Jun 16 22:49:55 2016 UTC (15 months, 1 week ago) by jcfr
STYLE: vtkMRMLViewDisplayableManager: Remove dead code. See mantis #2341

From: Thomas Greer <hastings.greer@kitware.com>

Revision 25186  Directory Listing
Modified Mon Jun 13 16:57:19 2016 UTC (15 months, 1 week ago) by msmolens
COMP: Update usage of legacy vtkMatrix4x4 method

VTK has deprecated the vtkMatrix4x4::operator[] method. In preparation for
upgrading the version of VTK that Slicer uses, update code that uses that method
to use GetElement()/SetElement() instead.

See https://github.com/Kitware/VTK/commit/d9c5ca0.

From: Max Smolens <max.smolens@kitware.com>

Revision 25185  Directory Listing
Modified Mon Jun 13 16:57:13 2016 UTC (15 months, 1 week ago) by msmolens
COMP: Update #include of deprecated vtkStreamer.h

VTK has deprecated the vtkStreamer class hierarchy. In preparation for upgrading
the version of VTK that Slicer uses, update usage of the deprecated classes.

This preemptively fixes errors like:

    C:\path\to\Slicer\Libs\vtkTeem\vtkHyperPointandArray.cxx(52) : error C2065: 'VTK_INTEGRATE_FORWARD' : undeclared identifier

See https://github.com/Kitware/VTK/commit/c9f7a5e.

From: Max Smolens <max.smolens@kitware.com>

Revision 25184  Directory Listing
Modified Mon Jun 13 04:40:57 2016 UTC (15 months, 1 week ago) by jcfr
STYLE: EMSegment: Fix 'Tag already registered' warnings.

This commit updates EMSegment and vtkMRMLScene::CopyRegisteredNodesToScene
to avoid warnings like this one:

//--------
Warning: In /home/jcfr/Projects/Slicer/Libs/MRML/Core/vtkMRMLScene.cxx, line 517
vtkMRMLScene (0x2590e90): Tag LinearTransform has already been registered, unregistering previous node class vtkMRMLLinearTransformNode to register vtkMRMLLinearTransformNode
//--------

Note that calling "GetClassNameByTag" in "CopyRegisteredNodesToScene"
changes "CopyRegisteredNodesToScene" complexity from O(n) to O(n^2).

Considering that

  (1) "CopyRegisteredNodesToScene" is only called from
      "GetReferencedSubScene",  itself used only in EMSegment,

and

  (2) testing times associated with EMSegment tests does not
      increase

.. removing the warning to facilitate the understanding of the test outputs
justifies the added complexity.

Revision 25171  Directory Listing
Modified Wed Jun 8 20:08:41 2016 UTC (15 months, 2 weeks ago) by jcfr
ENH: Add support for managing slice orientation presets

This commit generalizes the concept of slice orientation known as
Axial, Sagittal and Coronal so that it is possible to add, rename and
delete new ones.

Default presets (Axial, Sagittal and Coronal) are associated to a default
slice node in the application logic.

Handle orientation as 3x3 because maintaining sliceOrigin information
in matrices that are orientation presets is not relevant.

Notes:

(1) Mark Get/SetOrientationReference as protected: These methods are only
    used internally and could ultimately be removed by refactoring
    "RotateToVolumePlane()"

(2) Remove unused SetOrientationString: The method is not used in any Slicer
    extensions.

(3) Explicitly setting the orienation string to "Reformat" is
    not needed anymore because "GetOrientation()" or "GetOrientationString()"
    will return "Reformat" if the SliceToRAS matrix is not one of the preset.

(4) For sake of consistency, in the RenameSliceOrientationPreset, the
    orientation reference is also renamed.

(5) In "Copy()" method, Orientation and OrientationReference are set
    after the presets.

(6) Remove unused SetOrientationToReformat() function. At the time of this
    commit, it was used only in "SlicerRT/ExternalBeamPlanning/Logic/vtkSlicerExternalBeamPlanningModuleLogic"
    and the maintainer of the module planned on removing the call.

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Co-authored-by: Andras Lasso <lasso@queensu.ca>

From: Davide Punzo <punzodavide@hotmail.it>

Revision 25170  Directory Listing
Modified Wed Jun 8 17:58:12 2016 UTC (15 months, 2 weeks ago) by jcfr
STYLE: vtkMRMLSliceNode: Tweak doxygen of SetOrientationTo methods

Revision 25168  Directory Listing
Modified Wed Jun 8 07:43:43 2016 UTC (15 months, 2 weeks ago) by jcfr
ENH: vtkMRMLApplicationLogicTest1: Add test for Set/GetSliceLogics()

Revision 25167  Directory Listing
Modified Wed Jun 8 07:43:41 2016 UTC (15 months, 2 weeks ago) by jcfr
STYLE: vtkMRMLApplicationLogicTest1: Refactor code to allow adding new tests

Revision 25166  Directory Listing
Modified Wed Jun 8 06:48:13 2016 UTC (15 months, 2 weeks ago) by jcfr
ENH: vtkAddonMathUtilities: Add GetOrientationMatrix() function

Co-authored-by: Davide Punzo <punzodavide@hotmail.it>

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 25165  Directory Listing
Modified Wed Jun 8 06:48:11 2016 UTC (15 months, 2 weeks ago) by jcfr
ENH: vtkAddon: Add "CHECK_DOUBLE" testing macro

Co-authored-by: Davide Punzo <punzodavide@hotmail.it>

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 25164  Directory Listing
Modified Wed Jun 8 06:48:08 2016 UTC (15 months, 2 weeks ago) by jcfr
ENH: vtkAddon: Add method to compare 3x3 matrices

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Davide Punzo <punzodavide@hotmail.it>

Revision 25163  Directory Listing
Modified Wed Jun 8 06:48:06 2016 UTC (15 months, 2 weeks ago) by jcfr
STYLE: Rename "Matrix4x4AreEqual" to "MatrixAreEqual"

Anticipating the addition of method comparing matrices of different types,
this commit renames the method with a more general name.

Co-authored-by: Davide Punzo <punzodavide@hotmail.it>

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 25162  Directory Listing
Modified Wed Jun 8 06:48:03 2016 UTC (15 months, 2 weeks ago) by jcfr
STYLE: vtkMRMLSliceNode: Fix typo in doxygen comment

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 25161  Directory Listing
Modified Fri Jun 3 20:57:04 2016 UTC (15 months, 3 weeks ago) by jcfr
ENH: qMRMLThreeDViewControllerWidget: Set ctkAxesWidget labels from view node

This commit updates the code using feature integrated in
r24961 (ENH: Made view axis labels configurable) and
 r25157 (ENH: Update CTK to include ctkAxesWidget support for
setting AxesLabels)

From: Davide Punzo <punzodavide@hotmail.it>

Revision 25159  Directory Listing
Modified Fri Jun 3 20:38:20 2016 UTC (15 months, 3 weeks ago) by jcfr
STYLE: qMRMLSliceControllerWidget: Refactor code introducing mrmlOrientation()

Co-authored-by: Davide Punzo <punzodavide@hotmail.it>

Revision 25158  Directory Listing
Modified Fri Jun 3 20:38:17 2016 UTC (15 months, 3 weeks ago) by jcfr
STYLE: vtkMRMLSliceNode: Keep reference to matrix using smart pointers

Co-authored-by: Davide Punzo <punzodavide@hotmail.it>
Suggested-by: Andras Lasso <lasso@queensu.ca>

Revision 25151  Directory Listing
Modified Fri Jun 3 03:44:09 2016 UTC (15 months, 3 weeks ago) by jcfr
STYLE: Improve documentation of GetFirstNode()

GetFirstNode third parameter "byHideFromEditor" was not explained
in the doxygen documentation. It did not seem intuitive to have
a parameter that is a pointer when one might expect to specify a
boolean. The new doxygen string explains that this is a 3-state
variable that is either disregarded if the pointer is set to 0,
or the function only returns a node that matches the given value
(hidden from editor or not).

From: Francois Budin <francois.budin@gmail.com>

Revision 25143  Directory Listing
Modified Thu Jun 2 03:12:38 2016 UTC (15 months, 3 weeks ago) by jcfr
BUG: Remove invalid assert while populating the scene. Fixes #3445, #4199

This commit fixes a regression introduced in r25049 (COMP: qMRMLSceneModel:
Fix -Woverloaded-virtual and add comment.)

The assert was checking whether the index of the current node
matches the row count. However, while inserting nodes, the
logic adds a parent node if there isn't one. This insertion of
parent node increments the RowCache size. Next time the assert
was encountered, it would fail.

From: Sankhesh Jhaveri <sankhesh.jhaveri@kitware.com>

Revision 25126  Directory Listing
Modified Tue May 31 06:11:31 2016 UTC (15 months, 3 weeks ago) by jcfr
STYLE: Update python script to explicitly import teem

Revision 25110  Directory Listing
Modified Mon May 23 06:13:52 2016 UTC (16 months ago) by jcfr
STYLE: Remove obsolete variable VTK_USE_INSTANTIATOR_NEW

Explicitly setting this variable is not required by VTK since
kitware/VTK@1b707d4 from 2002-08-16.

Revision 25107  Directory Listing
Modified Sun May 22 00:07:33 2016 UTC (16 months ago) by pinter
COMP: Fixed build error on windows

Standard output did not accept const string with the << operator:
http://slicer.cdash.org/viewBuildError.php?buildid=831173
If my fix of choice is not satisfactory, please feel free to override.

Revision 25105  Directory Listing
Modified Sat May 21 11:24:33 2016 UTC (16 months ago) by lassoan
BUG: Fixed crash in vtkNRRDReader when attepting to read a 4D spatial file

Problem was that when scalar type was not supported, target memory area pointer for memcpy remained NULL.
Also reduced the number of cases when CanReadFile returns true but the reader cannot actually read the file.

The reader was really messy, so cleaned it up (smart pointers, variable definitions, formatting, etc), without any functional changes.

Revision 25097  Directory Listing
Modified Fri May 20 22:40:06 2016 UTC (16 months ago) by jcfr
STYLE: Refactor code to use vtkAddonMathUtilities::Matrix4x4AreEqual

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Davide <punzodavide@hotmail.it>

Revision 25096  Directory Listing
Modified Fri May 20 22:40:04 2016 UTC (16 months ago) by jcfr
STYLE: Add vtkAddonMathUtilities::Matrix4x4AreEqual method

This is done anticipating the refactoring of Slicer core
to use one implementation of this method.

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Davide <punzodavide@hotmail.it>

Revision 25095  Directory Listing
Modified Fri May 20 22:40:02 2016 UTC (16 months ago) by jcfr
STYLE: Add vtkAddonTestingUtilities and vtkAddonTestingMacros

This is done anticipating the addition of "vtkAddonMathUtilities" and
associated test to vtkAddon.

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 25092  Directory Listing
Modified Thu May 19 22:30:44 2016 UTC (16 months, 1 week ago) by jcfr
STYLE: vtkLoggingMacrosTest1: Fix comment

Revision 25080  Directory Listing
Modified Thu May 19 07:10:42 2016 UTC (16 months, 1 week ago) by jcfr
STYLE: Update vtkITK python test: "assert" is a statement not a function

See http://stackoverflow.com/questions/3112171/python-assert-with-and-without-parenthesis

Revision 25070  Directory Listing
Modified Wed May 18 23:35:46 2016 UTC (16 months, 1 week ago) by jcfr
STYLE: vtkMRMLNode: Fix "sign-compare" warning

Fix "sign-compare" warning originally introduced in r25028 (ENH: Added
Python-wrappable method for getting node references)

Revision 25069  Directory Listing
Modified Wed May 18 19:05:13 2016 UTC (16 months, 1 week ago) by lassoan
ENH: Improved speed of TPS transform writing

Initialization of kernel transforms may take minutes when there are hundreds of input points.
Temporary ITK transform that is only created for file writing does not need time-consuming initialization.

Revision 25067  Directory Listing
Modified Tue May 17 14:56:31 2016 UTC (16 months, 1 week ago) by alexy
BUG: 4190. Set default storage node for vtkMRMLDiffusionTensorDisplayPropertiesNode to NULL since it does not need to store any data in a separate file.

Revision 25066  Directory Listing
Modified Mon May 16 19:17:48 2016 UTC (16 months, 1 week ago) by lassoan
BUG: Fixed orientation reset of reformatted hot-linked slices

Problem: When slices were hot-linked, slices that had "Reformat" orientation string were kept being reformatted to the same position, orientation, and spacing when the user manipulated any of the views.

Root cause: The issue was that instead of checking the actual slice orientation, only orientation string was compared. Orientation string is "Reformat" for all orientations except axial, sagittal, and coronal.

Solution: Compare actual slice orientation (slice position, panning, and zoom are ignored) to decide if position, orientation, spacing, field-of-view of two slices has to be synchronized.

Revision 25064  Directory Listing
Modified Sun May 15 03:38:17 2016 UTC (16 months, 1 week ago) by lassoan
BUG: Fixed tests failing due to missing selection and interaction nodes

Method of retrieving selection and interaction nodes has changed. When legacy scenes are loaded without initializing the scene with an application logic (happens for some test cases) then selection and interaction nodes are not found. Legacy scenes are loaded without problems if the scene is initialized using application logic, so there is no need to add any backward compatibility mechanisms.

Updated selection and interaction nodes in legacy test scenes (changed node ID to the value that is now automatically generated in current scenes) to eliminate warnings.

Revision 25063  Directory Listing
Modified Sat May 14 00:55:31 2016 UTC (16 months, 1 week ago) by lassoan
ENH: Added "jump to slice" feature to 3D view

When the mouse is moved in a slice view with the shift key pressed, all slice views jump to the current mouse position.
This feature is now added for 3D views as well.

It is very useful for segmentation: when some artifacts or irregularities are visible in the reconstructed 3D models then it is very easy to find that place in the slice views and make corrections.

It also makes browsing of atlases easier: the user can point to a model in the 3D view and easily find the corresponding structure in the slice views.

Revision 25057  Directory Listing
Modified Sun May 8 05:01:00 2016 UTC (16 months, 2 weeks ago) by jcfr
PERF: Improve interaction node lookup

This commit updates the code to retrieve the node using its
singleton node id.

Suggested-by: Andras Lasso <lasso@queensu.ca>
Suggested-by: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25056  Directory Listing
Modified Sun May 8 05:00:56 2016 UTC (16 months, 2 weeks ago) by jcfr
PERF: Improve selection node lookup

Similarly to r25054, this commit updates the code to retrieve the node
using its singleton node id.

Suggested-by: Andras Lasso <lasso@queensu.ca>
Suggested-by: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25054  Directory Listing
Modified Sun May 8 01:54:52 2016 UTC (16 months, 2 weeks ago) by jcfr
PERF: Improve selection node lookup

This commit updates the code to retrieve the node using its singleton
node id.

This saves significant time (2 min to ~10s) when opening the Models
module with a scene including ~1200 model nodes. It saves a few percent
when "Include Fibers" is activated.

Co-authored-by: Andras Lasso <lasso@queensu.ca>
Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25053  Directory Listing
Modified Sat May 7 20:12:30 2016 UTC (16 months, 2 weeks ago) by jcfr
PERF: qMRMLSceneHierarchyModel: Refactor nodeIndex() function

Avoid repeated lookups to "GetAssociatedHierarchyNode" and save a few %.

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25051  Directory Listing
Modified Fri May 6 22:18:24 2016 UTC (16 months, 2 weeks ago) by jcfr
COMP: Fix vtkObserverManagerTest1 fail in debug

The following avoidable warning causes test failure in debug build:

```
101: Caller name = Testing Model NodeWarning: In /Users/inorton/git/slcr/s4/Libs/MRML/Core/vtkObserverManager.cxx, line 267
101: vtkObserverManager (0x7f80bb05d1b0): Observation 33 between vtkMRMLModelNode and vtkMRMLModelNode already exists.
```

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25050  Directory Listing
Modified Fri May 6 22:16:01 2016 UTC (16 months, 2 weeks ago) by jcfr
PERF: qMRMLSceneDisplayableModel: Factor out constant display node lookup.

This whole section of code is confusing and seems redundant, but it has
been refactored many times and everyone left it there so leave alone.
For now we can at least avoid repeated lookups and save a few %.

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25049  Directory Listing
Modified Fri May 6 09:03:31 2016 UTC (16 months, 2 weeks ago) by jcfr
COMP: qMRMLSceneModel: Fix -Woverloaded-virtual and add comment.

This commit follows up previous commit (PERF: qMRMLSceneModel: track and
reuse index during populateScene).

By introducing the previous commit, loading time of "NAC Brain Atlas 2015"
incluyding ~1600 nodes was reduced by ~8%. Experiment consisted in
[Start Slicer, Load the atlas] three times. Loading time was the one
reported in the log.

It fixes the "-Woverloaded-virtual" warnings by moving the method
"insertNode(vtkMRMLNode*, int)" to the pimpl.

//----------------
In file included from /path/to/Slicer-Release/Slicer-build/Modules/Remote/OpenIGTLinkIF/GUI/moc_qMRMLIGTLIOModel.cxx:9:0:
/path/to/Slicer-Release/Slicer-build/Modules/Remote/OpenIGTLinkIF/GUI/../../../../../OpenIGTLinkIF/GUI/qMRMLIGTLIOModel.h:72:26: warning:   by ‘qMRMLIGTLIOModel::insertNode’ [-Woverloaded-virtual]
   virtual QStandardItem* insertNode(vtkMRMLNode* node);
                          ^

                 from /path/to/Slicer-Release/OpenIGTLinkIF/GUI/qMRMLIGTLIOModel.cxx:26:
/path/to/Slicer/Libs/MRML/Widgets/qMRMLSceneModel.h:272:26: warning: ‘virtual QStandardItem* qMRMLSceneModel::insertNode(vtkMRMLNode*, int)’ was hidden [-Woverloaded-virtual]
   virtual QStandardItem* insertNode(vtkMRMLNode* node, int index);
                          ^
In file included from /path/to/Slicer-Release/OpenIGTLinkIF/GUI/qMRMLIGTLIOModel.cxx:26:0:
/path/to/Slicer-Release/OpenIGTLinkIF/GUI/qMRMLIGTLIOModel.h:72:26: warning:   by ‘qMRMLIGTLIOModel::insertNode’ [-Woverloaded-virtual]
   virtual QStandardItem* insertNode(vtkMRMLNode* node);
//----------------

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 25048  Directory Listing
Modified Fri May 6 09:03:29 2016 UTC (16 months, 2 weeks ago) by jcfr
PERF: qMRMLSceneModel: Track and reuse index during populateScene

Avoid unnecessary scene traversal on every call to `nodeIndex`.

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25046  Directory Listing
Modified Fri May 6 06:21:36 2016 UTC (16 months, 2 weeks ago) by jcfr
STYLE: qMRMLSceneModel: clarify cast

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25043  Directory Listing
Modified Tue May 3 03:55:03 2016 UTC (16 months, 3 weeks ago) by jcfr
PERF: use hashmap lookup instead of linear search.

Provides significant performance improvement in large scene loading task
(1200 models), from >20 minutes on master to 5:30.

The comment regarding `find` was incorrect: pointer comparison issue
only applies if a non-const pointer is used *as the key*.

Reviewed-by: Andras Lasso <lasso@queensu.ca>
Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 25034  Directory Listing
Modified Fri Apr 29 16:09:30 2016 UTC (16 months, 3 weeks ago) by alexy
ENH: Added SQLite MRML storage node, test for it, and also it's support in the Tables module.

Revision 25030  Directory Listing
Modified Mon Apr 25 22:20:30 2016 UTC (17 months ago) by lassoan
ENH: Allow forced refresh of qMRMLNodeAttributeTableWidget

Node may change without invoking modified event. For such cases it's useful to have a way of refreshing the widget using an external signal.

Revision 25029  Directory Listing
Modified Mon Apr 25 22:19:06 2016 UTC (17 months ago) by lassoan
ENH: Improved vtkMRMLTableNode::PrintSelf

Revision 25028  Directory Listing
Modified Mon Apr 25 22:18:40 2016 UTC (17 months ago) by lassoan
ENH: Added Python-wrappable method for getting node references

Used for scene inspection from Python scripted modules.

Revision 25017  Directory Listing
Modified Fri Apr 22 19:17:20 2016 UTC (17 months ago) by pinter
BUG: Fixed crash when node name not specified when creating subject hierarchy

Revision 25012  Directory Listing
Modified Mon Apr 18 02:21:38 2016 UTC (17 months, 1 week ago) by lassoan
ENH: Improved API for getting editable VTK transform from node

It is now simpler to ask for a transform that can be modified (it can be indicated with an extra optional flag).

Revision 25011  Directory Listing
Modified Sat Apr 16 05:48:49 2016 UTC (17 months, 1 week ago) by lassoan
ENH: Made displayed node type configurable in qMRMLNodeComboBox

Configuration is useful for cases when a more specific type name is preferred (e.g., instead of the generic "Create new SubjectHierarchy" option, a module can set up the widget to show "Create new Measurements").

Added methods:
Q_INVOKABLE void setNodeTypeLabel(const QString& label, const QString& nodeType);
Q_INVOKABLE QString nodeTypeLabel(const QString& nodeType)const;

Revision 25008  Directory Listing
Modified Wed Apr 13 16:39:57 2016 UTC (17 months, 1 week ago) by lassoan
BUG: Fixed subject hierarchy node naming tests

Revision 25006  Directory Listing
Modified Tue Apr 12 15:07:05 2016 UTC (17 months, 1 week ago) by lassoan
ENH: Fixed subject hierarchy folder node names

If a subject hierarchy node is associated with a data node then their names are synchronized; and to avoid name conflict, the subject hierarchy node gets a _SubjectHierarchy postfix in its name.

If there is no associated data node then the postfix is not necessary and it's confusing when it is shown to the user (e.g., when the user is asked to select a SubjectHierarchy folder). 

This commit changes the behavior so that _SubjectHierarchy is only added if a data node is specified.

Revision 25005  Directory Listing
Modified Tue Apr 12 06:27:26 2016 UTC (17 months, 2 weeks ago) by jcfr
COMP: Fix "-Wunused-parameter" and "-Wparentheses" warnings

Revision 25003  Directory Listing
Modified Mon Apr 11 04:57:13 2016 UTC (17 months, 2 weeks ago) by lassoan
BUG: Fixed edit properties option in node selectors

Fixes http://www.na-mic.org/Bug/view.php?id=2109

Now any module can associate a MRML node type with a module (instead of having a hardcoded list of modules
in qSlicerApplication) and when switching to a module, the chosen node is selected as active node.
Associations can be added by calling qSlicerApplication::registerNodeModule().
Multiple modules can be associated with the same MRML node type.

The best module for a specific node instance is determined run-time, by calling
qSlicerAbstractModuleWidget::nodeEditable() for each candidate and choosing
the one that has the highest confidence in handling the node.
This mechanism is used for selecting the CLI module that corresponds to a specific CLI module parameter node.
This mechanism is also used for switching to volume rendering module if a volume rendering clipping ROI node
is selected for editing (instead of switching to the Annotations module).
The most suitable module's qSlicerAbstractModuleWidget::setEditedNode() method is called to select the currently edited node.
qSlicerAbstractModuleWidget::nodeEditable() and qSlicerAbstractModuleWidget::setEditedNode() methods can be overridden
in scripted loadable modules as well.

As edited node selection is now possible using a clean, unified method call, it is no longer necessary
to access GUI widgets directly. Therefore, almost all editProperties() method calls in subject hierarchy plugins were
removed (replaced by a common implementation in the base class). This new, simplified method fixes robustness issues
of using node name filters for selecting a node in model hierarchy, inability to choose annotation hierarchy nodes, etc.

qSlicerAbstractModuleWidget::setEditedNode(vtkMRMLNode* node, QString role, QString context) has two extra (optional)
arguments. Role can be used to specify additional nodes for a module (e.g., if there are multiple inputs for a module
then role argument can select between them). Context can be used for specifying a sub-selection within a node (for
example, Segment Editor module can be activated for a selected segment - specified by 'context' - of a specific
segmentation node - specified by 'node').

Fixed code review errors (typos and API simplification).

Revision 24999  Directory Listing
Modified Mon Apr 4 21:06:28 2016 UTC (17 months, 3 weeks ago) by lassoan
ENH: Expand tables as needed if content is copied

Previously data was clipped when it did not fit into the table (and when the table was empty, it crashed).

Revision 24977  Directory Listing
Modified Mon Mar 21 22:48:40 2016 UTC (18 months ago) by jcfr
COMP: Fix -Wnarrowing and -Wunused-variable warnings

/path/to/Slicer/Modules/Loadable/Tables/qSlicerTablesModuleWidget.cxx: In member function ‘void qSlicerTablesModuleWidget::onMRMLTableNodeModified(vtkObject*)’:
/path/to/Slicer/Modules/Loadable/Tables/qSlicerTablesModuleWidget.cxx:167:21: warning: unused variable ‘tableNode’ [-Wunused-variable]
   vtkMRMLTableNode* tableNode = vtkMRMLTableNode::SafeDownCast(caller);
                     ^

/path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLOrientationMarkerDisplayableManager.cxx: In member function ‘void vtkMRMLOrientationMarkerDisplayableManager::vtkInternal::UpdateMarkerSize()’:
/path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLOrientationMarkerDisplayableManager.cxx:511:38: warning: narrowing conversion of ‘(maxX - minX)’ from ‘double’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
   int rendererSizeInPixels[2] = {maxX-minX, maxY-minY};
                                      ^
/path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLOrientationMarkerDisplayableManager.cxx:511:49: warning: narrowing conversion of ‘(maxY - minY)’ from ‘double’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
   int rendererSizeInPixels[2] = {maxX-minX, maxY-minY};
                                                 ^
/path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLRulerDisplayableManager.cxx: In member function ‘void vtkMRMLRulerDisplayableManager::vtkInternal::UpdateRuler()’:
/path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLRulerDisplayableManager.cxx:289:42: warning: narrowing conversion of ‘(maxX - minX)’ from ‘double’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
       int rendererSizeInPixels[2] = {maxX-minX, maxY-minY};
                                          ^
/path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLRulerDisplayableManager.cxx:289:53: warning: narrowing conversion of ‘(maxY - minY)’ from ‘double’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
       int rendererSizeInPixels[2] = {maxX-minX, maxY-minY};
                                                     ^

/path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLRulerDisplayableManager.cxx: In member function ‘void vtkMRMLRulerDisplayableManager::vtkInternal::SetupRuler()’:
/path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLRulerDisplayableManager.cxx:213:13: warning: unused variable ‘numberOfTickLines’ [-Wunused-variable]
   const int numberOfTickLines = 11;
             ^

/path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLRulerDisplayableManager.cxx:281:15: warning: unused variable ‘viewport’ [-Wunused-variable]
       double* viewport = this->MarkerRenderer->GetViewport();
               ^

/path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLRulerDisplayableManager.cxx:338:79: warning: narrowing conversion of ‘rulerLineMarginPixel’ from ‘int’ to ‘double’ inside { } is ill-formed in C++11 [-Wnarrowing]
   double pointOrigin[3] = {double(viewWidthPixel)/2.0, rulerLineMarginPixel, 0};

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24976  Directory Listing
Modified Mon Mar 21 22:48:38 2016 UTC (18 months ago) by jcfr
COMP: Fix -Wunused-parameter warning in vtkMRMLScene test

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24975  Directory Listing
Modified Mon Mar 21 22:48:36 2016 UTC (18 months ago) by jcfr
COMP: vtkITK: Fix -Wsign-compare and -Wmaybe-uninitialized warnings

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24974  Directory Listing
Modified Mon Mar 21 22:48:33 2016 UTC (18 months ago) by jcfr
ENH: Modernizing vcl_ to std::

In all supported compilers, the need for vcl_ specialized
functions has been removed.  there is no longer a need
to have these overrides, and code is easier to read
and easier to maintain without these specializations.

The vcl_* definitions can now be greatly simplified.
After removing specializations for early non-conformant
c++ compilers the end result was that only the
std:: version of the functions could ever be
used by the compiler.

ITK_SCRIPT=ITK/Utilities/Maintenance/VCL_ModernizeNaming.py
SRC_BASE_DIR=$(pwd)
for ext in ".h" ".cxx" ".cpp" ".hxx" ".hpp" ".txx"; do
  find ${SRC_BASE_DIR} -type f -name "*${ext}" \         -exec python ${ITK_SCRIPT} {} \;
done

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 24972  Directory Listing
Modified Thu Mar 17 19:50:21 2016 UTC (18 months, 1 week ago) by pinter
ENH: Added GetNodeReferenceRoles to MRML node to get list of references

Also minor changes in qMRMLTableModel to make it more readable, and set Modified event when checkbox is changed in boolean column.

Revision 24971  Directory Listing
Modified Tue Mar 15 16:50:40 2016 UTC (18 months, 1 week ago) by pinter
ENH: Implemented storage for special boolean column type in vtkMRMLTableNode

Revision 24970  Directory Listing
Modified Mon Mar 14 21:54:48 2016 UTC (18 months, 1 week ago) by pinter
ENH: Add special column type in qMRMLTableView to display checkboxes for boolean values

If a vtkBitArray is added as a column to vtkMRMLTableNode, then qMRMLTableView shows a checkbox instead of 0/1 text to make it easier to edit.
In the future color, position, and other data will possibly be added as further types. The mentioned two will be the same value type (double array), so will need to specify not just type but display option too.
qMRMLTableItemDelegate that will deliver this functionality is removed form the repository (it was temporarily added in the previous commit so that it can be accessed and uesd later).
Commented out lines were removed from other classes. Having commented code in the repository makes no sense: the repository itself can be used as a history, no need for three year old comments to make the code harder to read.

Revision 24969  Directory Listing
Modified Mon Mar 14 21:47:58 2016 UTC (18 months, 1 week ago) by pinter
ENH: Added delegate temporarily for qMRMLTableView

Will be removed in  next commit. Created to enable special editing of vtkMRMLTableNode cells in qMRMLTableView. This will be useful later for color editing, or if a better solution will be found for checkboxes. This delegate shows a checkbox in the center of the table cell (by default it is on the left), but only allows editing after double click. Thus this will be replaced by simple Qt mechanism with the checkbox on the left.

Revision 24968  Directory Listing
Modified Fri Mar 11 01:11:06 2016 UTC (18 months, 2 weeks ago) by jcfr
ENH: Update qMRMLChartView to expose jqplot marker size and line width options

Exposes two new options from jqplot:

* 'size' allows to select the size of the marker
* 'lineWidth' allows to select the width of a line.

This allows to change these options when using qMRMLChartView. Both
properties should be set with a string containing an integer (greater
than 0).

From: Francois Budin <francois.budin@kitware.com>

Revision 24967  Directory Listing
Modified Thu Mar 10 20:12:41 2016 UTC (18 months, 2 weeks ago) by pinter
BUG: Fixed table view Qt designer plugin

Revision 24961  Directory Listing
Modified Tue Mar 8 22:45:21 2016 UTC (18 months, 2 weeks ago) by lassoan
ENH: Made view axis labels configurable

For some applications standard left/right, posterior/anterior, inferior/superior axis labels are not optimal. For example for eye image analysis temporal/nasal labels are more appropriate than left/right.
Labels may have to be view-specific, e.g., show standard labels on a large overview image and show custom labels in a view that shows a small segmented structure.

Implemented solution:
* vtkMRMLAbstractViewNode stores axis labels (SetAxisLabel/GetAxisLabel methods can be used to set/get the labels)
* vtkMRMLViewDisplayableManager and vtkMRMLOrientationMarkerDisplayableManager read labels from vtkMRMLAbstractViewNode instead of using hard-coded strings to show in Cube and Axes orientation markers and 3D cube labels
* DataProbe read labels from vtkMRMLAbstractViewNode instead of using hard-coded string

No user interface is implemented, as this is an advanced feature for module developers. Example use:

sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')
sliceNode.SetOrientationMarkerType(slicer.vtkMRMLAbstractViewNode.OrientationMarkerTypeAxes)
sliceNode.SetOrientationMarkerSize(slicer.vtkMRMLAbstractViewNode.OrientationMarkerSizeLarge)
sliceNode.SetAxisLabel(0,'Proximal')
sliceNode.SetAxisLabel(1,'Distal')

viewNode = slicer.mrmlScene.GetNodeByID('vtkMRMLViewNode1')
viewNode.SetOrientationMarkerType(slicer.vtkMRMLAbstractViewNode.OrientationMarkerTypeAxes)
viewNode.SetOrientationMarkerSize(slicer.vtkMRMLAbstractViewNode.OrientationMarkerSizeLarge)
viewNode.SetAxisLabel(0,'Proximal')
viewNode.SetAxisLabel(1,'Distal')

Revision 24958  Directory Listing
Modified Fri Mar 4 18:50:25 2016 UTC (18 months, 3 weeks ago) by lassoan
ENH: Added 3D Table view to layouts

3D Table view consists of a 3D view and a table with a vertical divider.

Revision 24954  Directory Listing
Modified Fri Feb 26 19:03:47 2016 UTC (18 months, 4 weeks ago) by alexy
BUG: 3702. Fixed multiple causes of crashes on the scene close described in http://www.na-mic.org/Bug/view.php?id=3702. Also enable glyphs display for all scalar components on slices.

Revision 24952  Directory Listing
Modified Fri Feb 26 13:50:48 2016 UTC (18 months, 4 weeks ago) by lassoan
ENH: Improved axes-type orientation marker size and position

Axis labels are now scaled with the viewport to make good use of available space.
Tuned positioning of the axes orientation marker to be closer to the view's corner.

Revision 24951  Directory Listing
Modified Fri Feb 26 04:07:20 2016 UTC (18 months, 4 weeks ago) by lassoan
ENH: Consolidated transform point to/from world methods

vtkMRMLTransformableNode had very limited TransformPointToWorld/TransformPointFromWorld methods, which did not even support non-linear transforms.

vtkMRMLMarkupsNode had TransformPointToWorld/TransformPointFromWorld methods with a vtkVector3D input/output.

Consolidated these methods: all of them are now in vtkMRMLTransformableNode, support non-linear transforms, and vtkVector3D implementation uses the simple C-array-based method.

Revision 24950  Directory Listing
Modified Fri Feb 26 04:02:34 2016 UTC (18 months, 4 weeks ago) by lassoan
ENH: Added more GetTransform methods to vtkMRMLTransformNode

A few get functions were missing (it was not difficult to compute the inverse but it was unnecessary extra code at many places):
GetTransformFromNode
GetMatrixTransformFromWorld
GetMatrixTransformFromNode

Added static method for getting concatenated transforms between any two transform nodes:
GetTransformBetweenNodes
GetMatrixTransformBetweenNodes

NULL nodes are accepted as input, for uniform handling of transformed and non-transformed nodes.
This method allows computation of transforms from one node's coordinate system to the other with a single line of code, regardless of what kind of transform (if any) are applied on each node.

Revision 24948  Directory Listing
Modified Thu Feb 25 16:23:28 2016 UTC (19 months ago) by lassoan
STYLE: Deleted empty directories

Most of them were probably leftovers from git-svn commits.

Revision 24941  Directory Listing
Modified Mon Feb 22 22:51:59 2016 UTC (19 months ago) by pinter
ENH: Added data node inspector to Subject hierarchy module

Previously there was only one inspector for the subject hierarchy node, but many times it is interesting to see the properties of the associated data node too. A second inspector has been added in another collapsible box.
MRML node inspector changed so that the node information label (PrintSelf) is in a collapsible box itself, thus the attributes are visible when opening the inspector, and the potentially very long information can only be seen if the section isopened.
Removed stray files and directories that have been found to have no purpose.

Revision 24935  Directory Listing
Modified Thu Feb 18 04:33:09 2016 UTC (19 months, 1 week ago) by lassoan
STYLE: Removed duplicated code

Revision 24914  Directory Listing
Modified Tue Feb 2 20:14:08 2016 UTC (19 months, 3 weeks ago) by lassoan
ENH: Allow adding module directories by drag-and-drop

In Settings dialog / Modules panel, it is now possible to drag a directory to the directory list to add the directory (no need to click 'Add', select the directory, and click OK).

Implemented by adding this feature to qSlicerDirectoryListView widget. Also added a designer plugin for this widget to make it show up in Qt Designer.

Revision 24908  Directory Listing
Modified Fri Jan 29 18:29:10 2016 UTC (19 months, 3 weeks ago) by jcfr
ENH: Refactored view ruler and orientation marker

Ruler and orientation marker:
-----------------------------

- available in both 2D and 3D viewers

- easier to discover (available in viewer controller widgets and
  application settings)

- more customizable (size, visibility, custom ruler scales, orientation
  marker models)

- implemented with cleaner design (using displayable managers for
  rendering and regular node attributes for data storage).

New features:
-------------

- Ruler and orientation marker is configurable per viewer in the slice/3D
  view controller widgets (same way as all view options)

- Ruler and orientation marker can be shown in 3D view

- Default ruler orientation marker settings (and additional 3D view settings,
  such as orthographic projection, show 3D cube, axis labels, depth peeling)
  can be configured in the application settings (saved in .ini file)

- Allow using any model in the scene as orientation marker (for example, set a
  custom orientation marker in the 3D viewer:

    getNode('View1').SetOrientationMarkerHumanModelNodeID(getNode('ToriaClipped03').GetID() )

- All ruler and orientation marker settings (including custom orientation marker)
  are saved in the scene

- Added "thick" ruler mode: there is an option now to show the ruler with a
  thicker line and larger font so that it can be seen from a larger distance
  (e.g., interventional use)

Fixes bugs in the old implementation:
-------------------------------------

- ruler showed incorrect value when zoomed in or zoomed out very much (instead
  of hiding the ruler, it was kept displayed at an incorrect scale)

- Ruler was unusable in lightboxview: ruler line was clipped in half, label was
  not visible

- Some observers were not removed

Design changes compared to the old implementation:
--------------------------------------------------

- Ruler and orientation marker are rendered by displayable managers: This allows
  much simpler and more robust resource management and rendering update (there was
  previously an infinite loop in the orientation marker update causing Slicer crash
  by stack overflow).

- Orientation marker is loaded from a single file, color is stored in scalars:
  This makes the implementation simpler and displaying of multi-color custom
  models feasible.

Slicer core changes:
--------------------

- Removed roll/pitch/yaw buttons from 3D view: to reduce the additional
  complexity caused by adding 2 new buttons (for show/hide ruler and
  orientation marker)

Remarks and next steps:
----------------------

- Slice view corner annotations and scalar bar were left unchanged in the DataProbe
  module, as they were not obvious how to clean up and generalize. Slice corner
  annotations have to be made more generic, allowing displaying of custom text provided
  by various modules (see for example CornerAnnotations module).

- Scalar bar will need to be harmonized with the Color module's scalar bar display
  (that is currently only available in the 3D view).

From: Andras Lasso <lasso@queensu.ca>

Revision 24907  Directory Listing
Modified Fri Jan 29 18:29:02 2016 UTC (19 months, 3 weeks ago) by jcfr
ENH: Update vtkMRMLLogic API adding GetApplication(Home|Share)Directory()

Added common helper functions for accessing file resources from MRML
nodes.

Previously a Slicer-specific environment variable was hardcoded in
vtkMRMLFreeSurferProceduralColorNode.

Now the environment variable name is configurable in CMake and
GetApplicationHomeDirectory and GetApplicationShareDirectory methods
in vtkMRMLLogic can be used to determine resource file paths.

From: Andras Lasso <lasso@queensu.ca>

Revision 24906  Directory Listing
Modified Fri Jan 29 18:29:00 2016 UTC (19 months, 3 weeks ago) by jcfr
ENH: Update vtkMRMLSceneTest1 adding test for ResetNodes()

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24905  Directory Listing
Modified Fri Jan 29 18:27:12 2016 UTC (19 months, 3 weeks ago) by jcfr
ENH: Add infrastructure to support default MRML nodes

Allow modifying default node content: Scene can store "default" nodes. If
a default node is specified for a class then the content of that node will
be used to initialize new nodes and reset nodes.

Currently used only for 3D views but can be used for other purposes, too
(e.g., disable interpolation by default for volume nodes).

This is a backward incompatible change. Signature of

  vtkMRMLNode::Reset()

has been changed into

  vtkMRMLNode::Reset(vtkMRMLNode* defaultNode)

Co-authored-by: Csaba Pinter <csaba.pinter@queensu.ca>

From: Andras Lasso <lasso@queensu.ca>

Revision 24904  Directory Listing
Modified Fri Jan 29 05:00:15 2016 UTC (19 months, 3 weeks ago) by lassoan
BUG: Prevent crash if ITK->VTK transform conversion fails

Revision 24902  Directory Listing
Modified Thu Jan 28 04:21:57 2016 UTC (19 months, 4 weeks ago) by jcfr
BUG: Fix registration addressing regression in vtkITKTransformConverter.

Fixes #4139

This commit allows BRAINSFit registration to complete by addressing
a regression introduced in r24875 (BUG: Fix transform tests by not
using dynamic_cast in vtkITKTransformConverter)

It basically ensure the comparison of transform name includes
all derived type associated with itk::MatrixOffsetTransformBase

The python code allowing to reproduce the issue is reported below
and has been integrated into a self-test named "BRAINSFitRigidRegistrationCrashIssue4139"

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
import SampleData
from SampleData import SampleDataLogic
sampleDatalogic = SampleDataLogic()

fixed = sampleDatalogic.downloadMRBrainTumor1()
moving = sampleDatalogic.downloadMRBrainTumor2()

outputTransform = slicer.vtkMRMLLinearTransformNode()
slicer.mrmlScene.AddNode(outputTransform)

outputVolume = slicer.vtkMRMLScalarVolumeNode()
slicer.mrmlScene.AddNode(outputVolume)

parameters = {
'fixedVolume' : fixed,
'movingVolume' : moving,
'linearTransform' : outputTransform,
'outputVolume' : outputVolume,
'useRigid' : True
}
cmdLineNode = slicer.cli.runSync(slicer.modules.brainsfit, parameters=parameters)
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---

Reported-by: Christian Herz <christian.herz@mevis.fraunhofer.de>
Suggested-by: Hans Johnson <hans-johnson@uiowa.edu>

Revision 24891  Directory Listing
Modified Tue Jan 26 04:59:20 2016 UTC (20 months ago) by jcfr
ENH: Moved up vtkMRMLStorableNode in the MRML node hierarchy.

vtkMRMLStorableNode is not a children of vtkMRMLTransformable node anymore,
but directly a children of vtkMRMLNode.

This allows making a node storable without requiring it to be also
transformable. It is important for several node types (color maps, tables,
etc), which require separate storage node but are not transformable.

From: Andras Lasso <lasso@queensu.ca>

Revision 24885  Directory Listing
Modified Thu Jan 21 15:11:24 2016 UTC (20 months ago) by pinter
BUG: Prevent clash of subject hierarchy and other hierarchies

When a model not in a model hierarchy was deleted, then the associated subject hierarchy was found (if SH was enabled, which is by default disabled) due to using the generic vtkMRMLHierarchyNode, and the model node was deleted twice, causing a crash. By downcasting to the expected hierarchy type the crash does not occur.

Revision 24884  Directory Listing
Modified Wed Jan 20 02:50:36 2016 UTC (20 months ago) by lassoan
ENH: Added RemoveAllColumns convenience function to vtkMRMLTableNode

Revision 24875  Directory Listing
Modified Tue Jan 19 17:34:30 2016 UTC (20 months ago) by jcfr
BUG: Fix transform tests by not using dynamic_cast in vtkITKTransformConverter

This commit fixes a regression introduced
by InsightSoftwareConsortium/ITK@d1e9fe2 (BUG: Ensure Transform IO
factories are  registered once.) and integrated in r24836 (ENH: Update
ITKv4 to v4.9.0 release branch).

Following this ITK commit, the ITKIO transform libraries are build as
shared and dynamic_cast can NOT be used with templated classes that are
instantiated in a translation unit different than the one where they are
defined. It will work only if the classes are explicitly instantiated
and exported.

To workaround the issue, code that was relying on dynamic_cast is updated
to (1) ensure the objects are of the right type doing string comparison
and (2) then use static_cast instead of dynamic_cast.

See InsightSoftwareConsortium/ITK@d1e9fe2
and see http://stackoverflow.com/questions/8024010/why-do-template-class-functions-have-to-be-declared-in-the-same-translation-unit

This commit fixes the following tests:
  vtkSlicerTransformLogicTest1
  vtkMRMLNonlinearTransformNodeTest1

Revision 24874  Directory Listing
Modified Tue Jan 19 17:34:28 2016 UTC (20 months ago) by jcfr
STYLE: Refactor vtkITKTransformConverter to consistently template over type

This commit introduces the template function "ReadFromTransformFile()"
allowing to test reading of float or double transforms avoiding
dynamic_cast from "TransformBaseTemplate<float>*" to
"TransformBaseTemplate<double>*".

It also:
* renames typedefs used for conversion from VTK to ITK to explicitly
include the "Double" suffix.
* update ReadFromITKv3BSplineTransformFile() function to read ITKv3
transform as double.

Suggested-by: Matt McCormick <matt.mccormick@kitware.com>

Revision 24873  Directory Listing
Modified Mon Jan 18 20:01:08 2016 UTC (20 months, 1 week ago) by pinter
ENH: Hide subject hierarchy nodes by default

If subject hierarchy was enabled it made working in Data module very difficult due to the many SH nodes that showed up for every supported data node. Now the SH nodes are by default hidden, but can be shown by checking show hidden nodes. Testing was performed and no issues were found regarding this change.

Revision 24871  Directory Listing
Modified Sat Jan 16 05:33:35 2016 UTC (20 months, 1 week ago) by lassoan
BUG: Prevent changing window/level while adding markup point

Users often accidentally changed window/level of the image when added markup points (because they accidentally dragged the mouse when clicked with the left button).
Now we only change window/level in default mode (vtkMRMLInteractionNode::ViewTransform).

Revision 24860  Directory Listing
Modified Fri Jan 8 19:38:48 2016 UTC (20 months, 2 weeks ago) by jcfr
STYLE: qMRMLTableView: Simplify code introducing "Run Check macros.

Reviewed-by: Andras Lasso <lasso@queensu.ca>

Revision 24859  Directory Listing
Modified Fri Jan 8 19:38:46 2016 UTC (20 months, 2 weeks ago) by jcfr
STYLE: qMRMLTableView: Use Q_FUNC_INFO instead of hardcoded function name

See http://doc.qt.io/qt-4.8/qtglobal.html#Q_FUNC_INFO

Reviewed-by: Andras Lasso <lasso@queensu.ca>

Revision 24858  Directory Listing
Modified Fri Jan 8 19:38:43 2016 UTC (20 months, 2 weeks ago) by jcfr
STYLE: qMRMLTableView: Prefer function instead of macro

For sake of consistency with the rest of the code base, this commit
remove the macro introduced in r24783 (ENH: Added support for Tables)
and instead use a function.

Reviewed-by: Andras Lasso <lasso@queensu.ca>

Revision 24832  Directory Listing
Modified Wed Jan 6 15:50:17 2016 UTC (20 months, 2 weeks ago) by jcfr
STYLE: Fix unused variable warning in vtkMRMLStorageNodeTest1.cxx

This commit fixes the following warning:

vtkMRMLStorageNodeTest1.cxx:110:8: warning: unused variable ‘res’ [-Wunused-variable]
   bool res = true;
        ^

Revision 24831  Directory Listing
Modified Wed Jan 6 15:33:45 2016 UTC (20 months, 2 weeks ago) by jcfr
ENH: Removed unused vtkMRMLGlyphableVolumeDisplayPropertiesNode

The node was not used anywhere and the class was inadvertently
introduced in r7369 (ENH: merged demianVolumeGlyph-Simple branch
as vtkMRMLGlyphVolumeDisplayPropertiesNode)

Isaiah Norton also confirmed that the node is not needed.

From: Andras Lasso <lasso@queensu.ca>

Revision 24829  Directory Listing
Modified Wed Dec 23 21:43:20 2015 UTC (21 months ago) by lassoan
BUG: Fixed crash in vtkMRMLScene::SetURL

vtkMRMLScene::SetURL(NULL) crashed, fixed by NULL-pointer check (now it's equivalent with vtkMRMLScene::SetURL(""))

Revision 24828  Directory Listing
Modified Wed Dec 23 21:42:05 2015 UTC (21 months ago) by lassoan
ENH: Replace asserts by error handling in vtkMRMLScene

Problem: Essential checks were performed in vtkMRMLScene using asserts. These "work" in debug builds (makes the application crash) but asswerts are ignored in release builds.
Therefore, lack of checks caused crashes or silent errors in release builds.

Solution: Asserts were replaced by warning logs (instead of silently ignoring the errors) and/or returning with failure (instead of crashing).

Revision 24827  Directory Listing
Modified Wed Dec 23 21:37:53 2015 UTC (21 months ago) by lassoan
BUG: Fixed node references for singleton nodes

Problem: When importing a scene sometimes a slice node disappears and model nodes become corrupted.

Root cause: Node ID in node references in singleton nodes (such as slice views) are not updated when a scene is imported. The imported singleton node simply overwrites the old singleton node but in case of node ID conflicts, the singleton node is not notified about ID changes. This may cause mix-up of display nodes of slice (model) nodes and regular model nodes.

Fix: Handle node ID changes in singleton nodes properly. Keep the old singleton node object, overwrite its contents with the imported node content, track any node ID changes for singleton nodes (not very common), and call SetSceneReferences for the imported singleton node (this will make the singleton node notified about relevant node ID changes).

Revision 24826  Directory Listing
Modified Wed Dec 23 21:26:28 2015 UTC (21 months ago) by lassoan
ENH: Improved MRML tests

* Added output check to MRML core cxx methods (if any MRML node logs an unexpected error or warning during a test then it makes the test return with failure).
* Changed very long test macros to regular methods. It allows step-by-step debugging, getting exact error location (not just where the macro was called), simpler editing of the code (no need to put backslashes at the end of every line).
* Created a test macro for exercising all applicable MRML methods (ExerciseAllBasicMRMLMethods), which determines which methods should be tested by dynamic casting. Changed all MRML tests to use this single macro. It is still a macro to be able to run the function and log the line number in a single line using a simple syntax.
* Separated test macros (vtkMRMLCoreTestingMacros) and functions (vtkMRMLCoreTestingUtilities.h/txx/cxx) for clarity.
* Replaced several-line checks by CHECK_... macros for shorter code and simpler syntax. The check macros just gather the line number, call a check method, and return in case of an error: problems can still be analyzed using step-by-step debugging.
* Replaced bool return values by int (EXIT_FAILURE/EXIT_SUCCESS) at many places. It allows propagating the same error code from any level back to the main() function, using the same CHECK_... macros at every level.
* Re-enabled and fixed old tests that did not work in the core MRML library because they depended on classes that are not in MRML core. Moved tests to the module where the corresponding MRML node was defined. Updated obsolete scene files.
* Added thorough testing of node references between singleton and non-singleton nodes.

Revision 24825  Directory Listing
Modified Wed Dec 23 21:09:55 2015 UTC (21 months ago) by lassoan
BUG: Removed incorrect error log in vtkMRMLFreeSurferProceduralColorNode

An error was logged in vtkMRMLFreeSurferProceduralColorNode::ReadXMLAttributes for all XML attributes that were handled in the Superclass;

Revision 24824  Directory Listing
Modified Wed Dec 23 21:07:30 2015 UTC (21 months ago) by lassoan
ENH: Use weak pointer to store pointer to scene in nodes to avoid crashes

Nodes stored a simple pointer to the scene, therefore when the scene was deleted the node had a dangling pointer (pointer pointing to an invalid memory area), which caused crashes in certain use cases.

Fix: Use weak pointer to store pointer to scene. When the scene is deleted the weak pointer is set to NULL, and a NULL-pointer check is always done before accessing the scene pointer.

Revision 24822  Directory Listing
Modified Wed Dec 23 19:18:52 2015 UTC (21 months ago) by lassoan
ENH: Log error if vtkMRMLTransformNode::Get/SetMatrixTransformToParent fails

The vtkMRMLTransformNode::GetMatrixTransformToParent and vtkMRMLTransformNode::SetMatrixTransformToParent operations are not completed therefore it is not just a warning (potential error) but an error (definitely wrong behavior).

Revision 24820  Directory Listing
Modified Tue Dec 22 04:50:53 2015 UTC (21 months ago) by lassoan
BUG: Fixed of truncation of imported transforms

Fixes http://na-mic.org/Mantis/view.php?id=4114

Expected behavior of the translation slider widgets in global mode is to set the slider value to the current translation value.
However, if the current translation value is out of the slider's range then the range has to be updated to accommodate the large value.

There were two issues with the automatic range update:
1. If current transform in the qMRMLTransformSliders widget changed then the range was updated to the previous transform => fixed by computing it for the new Transform
2. Sometimes the transform node modified events are called in qMRMLLinearTransformSlider than the slider range is updated in qMRMLTransformSliders, which caused setting of a truncated value => fixed by not attempting to set a value in the slider that is not reachable (move the slider to the closest value, without emitting any event)

Also added a test case to qMRMLTransformSlidersTest1 to detect similar problems in the future.

Revision 24814  Directory Listing
Modified Fri Dec 11 21:43:48 2015 UTC (21 months, 2 weeks ago) by lassoan
BUG: Fixed printing of node references

Fixed printing of node references in vtkMRMLNode::PrintSelf and in the node inspector in Data module.

Revision 24813  Directory Listing
Modified Thu Dec 10 17:15:03 2015 UTC (21 months, 2 weeks ago) by lassoan
BUG: Fixed vtkTransform::ApplyTransformMatrix crash

How to reproduce:

c=getNode('FullRainbow')
m=vtk.vtkMatrix4x4()
c.ApplyTransformMatrix(m)

Problem:
vtkTransform::ApplyTransform and vtkTransform::ApplyTransformMatrix are calling each other. Most of the time at least one is overridden, so no crash occurs.

Solution:
Removed calling of vtkTransform::ApplyTransformMatrix from vtkTransform::ApplyTransform. If a class has a more efficient version of transform application for linear transforms then this call can be added to vtkTransform::ApplyTransform in that specific class.
Removed vtkTransform::ApplyTransformMatrix where it is not necessary (when it's just a more complicated and possibly slower version of ApplyTransform).

Revision 24811  Directory Listing
Modified Wed Dec 9 22:54:37 2015 UTC (21 months, 2 weeks ago) by lassoan
BUG: CLI several module GUI bugs

Fix for need to re-select node after changing some parameters (http://www.na-mic.org/Bug/view.php?id=4090):
- Create a CLI node when switching to CLI if a compatible node is not available already (to not require users create a CLI node before starting interacting with the module). (http://www.na-mic.org/Bug/view.php?id=4090)
- Disable CLI module parameter editing widgets if no CLI node is selected (e.g., after scene close).
- Prevent crash in qSlicerCLIModuleUIHelper::setCommandLineModuleParameter when the method is called before a scene is set.

Fix for editable output values (http://www.na-mic.org/Bug/view.php?id=2402 and http://www.na-mic.org/Bug/view.php?id=2842):
- Prevent editing of CLI output values.
- Print current parameter values in vtkMRMLCommandLineModuleNode::PrintSelf instead of the module description, which is long and in general not informative.
- Added a method for printing module description (vtkMRMLCommandLineModuleNode::GetModuleDescriptionAsString).

Fix for editing vector fields:
- Prevent moving the cursor to the end of the line when editing a vector field (e.g., try to edit the first value in Float Vector Parameter in Execution Model Tour)

Revision 24809  Directory Listing
Modified Mon Dec 7 19:20:20 2015 UTC (21 months, 2 weeks ago) by lassoan
BUG: Fixed crash in vtkMRMLTransformNode::GetMatrixTransformToNode

How to reproduce the crash:
# Create transform hierarchy t1-t2-t3
t1=slicer.vtkMRMLTransformNode()
t2=slicer.vtkMRMLTransformNode()
t3=slicer.vtkMRMLTransformNode()
slicer.mrmlScene.AddNode(t1)
slicer.mrmlScene.AddNode(t2)
slicer.mrmlScene.AddNode(t3)
t2.SetAndObserveTransformNodeID(t1.GetID())
t3.SetAndObserveTransformNodeID(t2.GetID())
# Get t3 to t1 transform
m = vtk.vtkMatrix4x4()
t3.GetMatrixTransformToNode(t1, m)

The problem was caused by infinite recursion. There were no tests for GetMatrixTransformToNode and GetTransformToNode methods and they did not work well.
Also, the transform node heavily used recursion in several methods when only a simple iteration on the transform tree was needed, which made computation time magnitudes higher (although it was still very quick, so it was not noticeable) and made the code harder to read and debug.

Solution:
Replaced all the unnecessary recursive method calls by simple for loops.
Added tests for Get(Matrix)TransformToNode methods.

Revision 24801  Directory Listing
Modified Tue Dec 1 20:06:37 2015 UTC (21 months, 3 weeks ago) by jcfr
STYLE: Remove VTKv5 support

As discussed during the developer hangout of 2015-03-31, this commit
removes support for VTKv5.

Most of the h/cxx files have been updated automatically using the
script "slicer_remove_vtk5_support.py" [1]. See below.

The remaining of h/cxx, python and CMake files have been updated
manually.


slicer_remove_vtk5_support.py:
cd ~/Project/Slicer
~/Download/slicer_remove_vtk5_support.py $(ack -l VTK_MAJOR_VERSION)

[1] https://gist.github.com/jcfr/91d2f5d07c2a36320e48

Revision 24798  Directory Listing
Modified Tue Dec 1 18:51:08 2015 UTC (21 months, 3 weeks ago) by pinter
ENH: Added CLI support for Subject hierarchy #1

1. Moved vtkMRMLSubjectHierarchyNode and constants to MRML core. Moved transform related functions to SH logic from the node
2. Added reference argument support for Volume (image) and Model (geometry) nodes when outputs of a CLI module

Revision 24797  Directory Listing
Modified Tue Dec 1 16:31:08 2015 UTC (21 months, 3 weeks ago) by pinter
ENH: Added labelmap conversion to Volumes module

1. Changed LabelMap checkbox to Volume type label showing the node tag without the Volume postfix (as scalar volume has the tag "Volume", "Scalar" is shown instead of empty string)
2. Add extra section into Volumes module, because
a. Label volume conversion cannot be added in the volume info widget due to scope issues (volumes logic not accessible from MRML widgets)
b. Conversion operation doesn't fit into the idea of "volume info"
3. Reorganized labelmap creation functions in volumes logic. Moved and corrected the body of FillLabelVolumeFromTemplate to CreateLabelVolumeFromVolume. Call the new function from CreateAndAddLabelVolume and FillLabelVolumeFromTemplate. Correction in CreateLabelVolumeFromVolume includes deep copy of the image data instead of keeping a floating threshold filter and setting connection (besides it seems to be unstable, it also did not work, dimensions of the volume were zeroes)
4. Removed margin from volumes info widget to make volumes module look more uniform

Revision 24796  Directory Listing
Modified Tue Dec 1 13:46:21 2015 UTC (21 months, 3 weeks ago) by lassoan
ENH: Expose qMRMLTableView methods in Python interface

Revision 24794  Directory Listing
Modified Tue Dec 1 00:30:33 2015 UTC (21 months, 3 weeks ago) by lassoan
COMP: Fixed Mac build errors and warnings

Thanks to Nicole Aucoin for testing and suggesting fixes.

Revision 24785  Directory Listing
Modified Mon Nov 30 20:42:44 2015 UTC (21 months, 3 weeks ago) by lassoan
ENH: Clear selection after deleting row/column from table

Revision 24783  Directory Listing
Modified Mon Nov 30 19:46:18 2015 UTC (21 months, 3 weeks ago) by lassoan
ENH: Added support for Tables

* New module added: Tables. Create create/view/edit/delete tables, freeze column/row header, lock to read-only (vtkMRMLTableNode).
* Tables can be shown in the view layout (new layout added: Four-up table, more can be added as needed)
* Load/save csv, tsv, txt files as table nodes
* Copy-paste to/from Excel
* SubjectHierarchy plugin (show/hide, edit, clone tables)
* Use tables as input/output for CLI modules (PET Standard Uptake Value Computation module is updated to use tables; there was no need to change the Slicer Execution Model, the Table data type was already usable)
* Reusable widget added for viewing/editing tables in C++ and Python modules

Revision 24781  Directory Listing
Modified Mon Nov 30 19:42:24 2015 UTC (21 months, 3 weeks ago) by lassoan
ENH: Added convenience macros to vtkMRMLCoreTestingUtilities

CHECK_... macros allow single-line tests.

Revision 24780  Directory Listing
Modified Mon Nov 30 19:13:46 2015 UTC (21 months, 3 weeks ago) by lassoan
ENH: Simplified vtkSlicerApplicationLogic

Problem:
vtkSlicerApplicationLogic had node-specific logic for creating storage and display nodes.
This made it necessary to modify vtkSlicerApplicationLogic whenever a new node type is added.
CreateDefaultStorageNode and CreateDefaultDisplayNodes methods are introduced some time ago
to encapsulate all node-specific storage and display node creation. These methods were partly
used by vtkSlicerApplicationLogic, but not for all cases; also, CreateDefaultStorageNode and
CreateDefaultDisplayNodes methods were not implemented for all nodes.

Solution:
Moved node-specific storage and display node creation code to CreateDefaultStorageNode and
CreateDefaultDisplayNodes methods of the corresponding nodes.
Replaced node-specific logic from vtkSlicerApplicationLogic by CreateDefaultStorageNode and
CreateDefaultDisplayNodes method calls.

Revision 24773  Directory Listing
Modified Wed Nov 25 06:41:47 2015 UTC (22 months ago) by jcfr
STYLE: vtkTeem: Remove setting of policy CMP0033 unneeded since teem r6233

Revision 24772  Directory Listing
Modified Wed Nov 25 06:41:45 2015 UTC (22 months ago) by jcfr
STYLE: Remove setting of CMP0017 to OLD in Libs

This commit is the first of series modernizing the build system by removing
the setting of CMake policies to OLD.

Since the policy is still set to OLD in the top level CMakeLists.txt, this
change will have no impact.

Revision 24766  Directory Listing
Modified Sat Nov 21 05:30:43 2015 UTC (22 months ago) by jcfr
STYLE: vtkThreeDViewInteractorStyle: Refactor code introducing keySym ivar

Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Alexis Girault <alexis.girault@kitware.com>

Revision 24765  Directory Listing
Modified Sat Nov 21 05:30:40 2015 UTC (22 months ago) by jcfr
STYLE: vtkThreeDViewInteractorStyle: Display error message if KeySym null

Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Alexis Girault <alexis.girault@kitware.com>

Revision 24764  Directory Listing
Modified Sat Nov 21 04:50:33 2015 UTC (22 months ago) by jcfr
BUG: vtkThreeDViewInteractorStyle: Exit OnKeyPress if CameraNode null

In the vtkThreeDViewInteractorStyle, OnKeyPress did not check for
the cameraNode before applying transformations to the camera,
resulting in Slicer crashing if the InteractorStyle was changed
and reset to a vtkThreeDViewInteractorStyle.

Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Alexis Girault <alexis.girault@kitware.com>

Revision 24763  Directory Listing
Modified Sat Nov 21 04:28:20 2015 UTC (22 months ago) by jcfr
STYLE: qMRMLSliceControllerWidget: Add ctor allowing to use specialized pimpl.

Suggested-by: Davide Punzo <punzodavide@hotmail.it>

Revision 24762  Directory Listing
Modified Sat Nov 21 04:28:16 2015 UTC (22 months ago) by jcfr
STYLE: qMRMLSliceWidget: Add ctor allowing to use specialized pimpl.

Suggested-by: Davide Punzo <punzodavide@hotmail.it>

Revision 24757  Directory Listing
Modified Fri Nov 20 02:59:35 2015 UTC (22 months ago) by jcfr
ENH: Added output checking to module CXX tests

Added a new option (WITH_VTK_ERROR_OUTPUT_CHECK) to slicerMacroConfigureModuleCxxTestDriver
that enables checking of error and warning messages. If the option is enabled then the test
fails if unexpected error or warning is logged.

Enabled the option for all tests that had debug leaks check option (WITH_VTK_DEBUG_LEAKS_CHECK)
enabled. Fixed failing tests by fixing the test, the tested code, or (most frequently) marking
expected errors/warning (using TESTING_OUTPUT_ASSERT_ERRORS_BEGIN() / TESTING_OUTPUT_ASSERT_ERRORS_END()
and similar macros).

Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Andras Lasso <lasso@queensu.ca>

Revision 24754  Directory Listing
Modified Thu Nov 19 22:15:12 2015 UTC (22 months ago) by jcfr
STYLE: vtkMRMLColorLogic: Improve AddDefaultColorNodes() doxygen

Reviewed-by: Nicole Aucoin <nicole@bwh.harvard.edu>

Revision 24753  Directory Listing
Modified Thu Nov 19 19:59:29 2015 UTC (22 months ago) by naucoin
STYLE: Refactor terminology tests for fine grain error reporting

Moved the repeated code into the ParseTerm test method and pass in
expected success flag and term values.
Updated the color logic for more clear print outs.
Use the CheckString utility to encapsulate the string comparisons
on the terminology methods.
Group terminology tests together and provide better
descriptive strings.

Issue #4047

Revision 24752  Directory Listing
Modified Wed Nov 18 17:52:09 2015 UTC (22 months, 1 week ago) by lassoan
BUG: Fixed build error on Windows

Revision 24751  Directory Listing
Modified Wed Nov 18 16:54:14 2015 UTC (22 months, 1 week ago) by jcfr
COMP: vtkMRMLColorLogic: Fix VS2013 build error

On Visual Studio 2013 it's necessary to add the following to
vtkMRMLColorLogic.cxx:

to fix the following errors:

C:\path\to\Slicer\Libs\MRML\Logic\vtkMRMLColorLogic.cxx(1452): error C2039: 'not1' : is not a member of 'std'
C:\path\to\Slicer\Libs\MRML\Logic\vtkMRMLColorLogic.cxx(1452): error C2039: 'ptr_fun' : is not a member of 'std'
C:\path\to\Slicer\Libs\MRML\Logic\vtkMRMLColorLogic.cxx(1452): error C2065: 'ptr_fun' : undeclared identifier
C:\path\to\Slicer\Libs\MRML\Logic\vtkMRMLColorLogic.cxx(1452): error C2062: type 'int' unexpected
C:\path\to\Slicer\Libs\MRML\Logic\vtkMRMLColorLogic.cxx(1454): error C2039: 'not1' : is not a member of 'std'
C:\path\to\Slicer\Libs\MRML\Logic\vtkMRMLColorLogic.cxx(1454): error C2039: 'ptr_fun' : is not a member of 'std'
C:\path\to\Slicer\Libs\MRML\Logic\vtkMRMLColorLogic.cxx(1454): error C2065: 'ptr_fun' : undeclared identifier
C:\path\to\Slicer\Libs\MRML\Logic\vtkMRMLColorLogic.cxx(1454): error C2062: type 'int' unexpected
C:\path\to\Slicer\Libs\MRML\Logic\vtkMRMLColorLogic.cxx(1452): error C3861: 'not1': identifier not found
C:\path\to\Slicer\Libs\MRML\Logic\vtkMRMLColorLogic.cxx(1454): error C3861: 'not1': identifier not found

Tested-by: Andriy Fedorov <fedorov@bwh.harvard.edu>

From: Max Smolens <max.smolens@kitware.com>

Revision 24750  Directory Listing
Modified Wed Nov 18 16:54:12 2015 UTC (22 months, 1 week ago) by jcfr
COMP: vtkMRMLColorLogic: Fix windows build error related to isspace

Since the function "std::isspace" is declared in <local>, but <local>
library is not found in VS2008 STL, this commit includes "ctype.h" where
isspace() function is declared.

This commit fixes the following error:

42>45>..\..\..\..\..\Slicer-1\Libs\MRML\Logic\vtkMRMLColorLogic.cxx(1453) : error C2039: 'isspace' : is not a member of 'std'

From: Andras Lasso <lasso@queensu.ca>

Revision 24749  Directory Listing
Modified Wed Nov 18 16:54:11 2015 UTC (22 months, 1 week ago) by jcfr
STYLE: vtkMRMLColorLogic: Improve readability adding separator comment

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24748  Directory Listing
Modified Wed Nov 18 02:21:30 2015 UTC (22 months, 1 week ago) by lassoan
BUG: Fixed crash when deleting a model display node

Revision 24747  Directory Listing
Modified Tue Nov 17 20:46:04 2015 UTC (22 months, 1 week ago) by naucoin
COMP: Fix compiler warning about qMRMLLayoutManager unused variable

This fix removes many compiler warnings of the form:
warning: unused variable 'd'
      [-Wunused-variable]
  Q_D(const qMRMLLayoutManager);
  ^


Revision 24746  Directory Listing
Modified Tue Nov 17 16:08:25 2015 UTC (22 months, 1 week ago) by naucoin
COMP: fixing windows build errors in vtkMRMLColorLogic

This commit is to fix the build error introducted in r24742 (ENH: Add terminology
information to color picker in Editor)
42>44>c:\d\n\slicer-1\libs\mrml\logic\vtkMRMLColorLogic.h(73) : error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)

Issue #4047


Revision 24745  Directory Listing
Modified Tue Nov 17 05:12:21 2015 UTC (22 months, 1 week ago) by jcfr
COMP: Fix Linux build error in vtkMRMLColorLogic

This commit fixes a build error introduced in r24742 (ENH: Add terminology
information to color picker in Editor)

/path/to/Slicer/Libs/MRML/Logic/vtkMRMLColorLogic.cxx:1402:26: error: ‘find_if’ is not a member of ‘std’
   ret.erase(ret.begin(), std::find_if(ret.begin(),ret.end(),
                          ^
/path/to/Slicer/Libs/MRML/Logic/vtkMRMLColorLogic.cxx:1404:13: error: ‘find_if’ is not a member of ‘std’
   ret.erase(std::find_if(ret.rbegin(),ret.rend(),
             ^
/path/to/Slicer/Libs/MRML/Logic/vtkMRMLColorLogic.cxx: In member function ‘bool vtkMRMLColorLogic::ParseTerm(std::string, vtkMRMLColorLogic::StandardTerm&)’:
/path/to/Slicer/Libs/MRML/Logic/vtkMRMLColorLogic.cxx:1428:14: error: ‘count’ is not a member of ‘std’
   size_t n = std::count(str.begin(), str.end(), ';');
              ^

Revision 24744  Directory Listing
Modified Tue Nov 17 05:12:19 2015 UTC (22 months, 1 week ago) by jcfr
STYLE: Fix "sign-compare" warning in vtkMRMLColorLogic

This commit fixes a warning introduced by r24742 (ENH: Add terminology
information to color picker in Editor)


/path/to/Slicer/Libs/MRML/Logic/vtkMRMLColorLogic.cxx:101:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < this->ColorFiles.size(); i++)
                                             ^
/path/to/Projects/Slicer/Libs/MRML/Logic/vtkMRMLColorLogic.cxx:106:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < this->UserColorFiles.size(); i++)
                                                 ^
/path/to/Projects/Slicer/Libs/MRML/Logic/vtkMRMLColorLogic.cxx:112:56: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < this->TerminologyColorFiles.size(); i++)
                                                        ^

Revision 24742  Directory Listing
Modified Mon Nov 16 22:46:35 2015 UTC (22 months, 1 week ago) by naucoin
ENH: Add terminology information to color picker in Editor

Added terminology files, read them on start up, associate
with the generic anatomy colors node.
Add accessors to the color logic as well as basic methods to
allow creating new terminologies (used by the Reporting extension).
Created Python callable utility methods to allow scripted access[1].
Add read only widgets to the Editor, shown if the selected
color node has terminology associated with it (using
node attributes).
Added testing for the terminology functionality to vtkSlicerColorLogicTest (rather than
in vtkMRMLColorLogicTest1 since the Colors module logic adds the terminology files).
Pass the color logic to the color model so that it can look up
terminology information to set the tool tips on the color table
entries.
Minor changes to respond to feedback on the pull request (CMake,
references, default terminology).
[1] Utility accessor functions:
- GetTerminologyFromLabel takes in the strings defining the color label
categorization and the standard term elements and returns the specific term.
- Get the colon concatenated full standard term values via
GetSegmentedPropertyCategory, GetSegmentedPropertyType, GetSegmentedPropertyTypeModifier,
GetAnatomicRegion, GetAnatomicRegionModifier

Issue #4047

Revision 24739  Directory Listing
Modified Thu Nov 12 21:59:30 2015 UTC (22 months, 1 week ago) by lassoan
BUG: Fixed transform nod stuck StartModify

When vtkMRMLTransformNode::Copy was called with an invalid argument the method
returned after StartModify without calling EndModify.

Changed the order of operations to prevent this.

Revision 24738  Directory Listing
Modified Thu Nov 12 21:55:53 2015 UTC (22 months, 1 week ago) by lassoan
BUG: Fixed crash in qMRMLItemDelegate

Crash occurred while editing a floating-point value with the sliderWidget.
Added null-pointer check and warning log.

Revision 24734  Directory Listing
Modified Thu Nov 12 17:50:11 2015 UTC (22 months, 1 week ago) by jcfr
BUG: Revert workaround for MRML Scene import limitation. See #4081

This commit reverts r24723 (BUG: Workaround MRML Scene import
limitation. Fixes #3462, #2849 and #4080).

It turns out that this commit had unintended side effects. The following
tests were failing:

 py_LandmarkRegistration
 py_SlicerMRBMultipleSaveRestoreTest
 py_SlicerMRBMultipleSaveRestoreLoopTest
 py_SlicerMRBTest
 py_NeurosurgicalPlanningTutorialMarkupsSelfTest
 qMRMLSceneModelTest

After concerting with the core team, since the correct fix involves
changes in the core of MRML, we decided to revert this commit and mark
the tickets #3462, #2849, #4080 as known issues in the release note.

Revision 24727  Directory Listing
Modified Wed Nov 11 22:32:00 2015 UTC (22 months, 2 weeks ago) by jcfr
BUG: Do not show "Disable fiducial" popup when testing is enabled. See #1690

This commit ensure the popup introduced in previous commit will not
wait for user input when test are running.

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24726  Directory Listing
Modified Wed Nov 11 22:31:58 2015 UTC (22 months, 2 weeks ago) by jcfr
BUG: Disable fiducials in light box mode. See #1690

Fiducials are not being properly positioned when in light box mode, this
change disables them and gives the user a warning that they are being
disabled (new fiducials can still be placed, but will not be visible until
you exit light box mode).

This change fixes bugs that were left from the attempt to use the point
handle widgets in 2D so that they can be properly hidden: fix the
visibility setting on the point handles in light box mode, disable
the point handles when invisible so that they don't become visible
when the mouse is near it, updated a visibility check comparision
to match return type from method.

Also removed warning messages by casting the 3d handles before changing
the picking state.

Fixed a bug wherein if you had a mix of fiducials having been placed
in lightbox and not light box mode, the seed widget would have a mix
of 2d and 3d handles.

This fix removes all the current handles so that they're properly
recreated as the necessary type.

Issue #1690

From: Nicole Aucoin <nicole@bwh.harvard.edu>

Revision 24724  Directory Listing
Modified Wed Nov 11 21:12:13 2015 UTC (22 months, 2 weeks ago) by jcfr
BUG: Fix #2466, MRMLIDImageIO crashes with DWMRI volume

http://www.na-mic.org/Bug/view.php?id=2466

Restore handling of b-values and gradients, and make code consistent
with DWIConvert: use the `sqrt(b/b_max)` scaling factor as documented
on the NA-MIC wiki page:

http://wiki.na-mic.org/Wiki/index.php/NAMIC_Wiki:DTI:Nrrd_format

Reviewed-by: Francois Budin <fbudin@unc.edu>
Reviewed-by: Lauren O'Donnell <odonnell@bwh.harvard.edu>
Reviewed-by: Steve Pieper <pieper@isomics.com>
Tested-by: Isaiah Norton <inorton@bwh.harvard.edu>

From: Isaiah Norton <inorton@bwh.harvard.edu>

Revision 24723  Directory Listing
Modified Wed Nov 11 20:04:19 2015 UTC (22 months, 2 weeks ago) by jcfr
BUG: Workaround MRML Scene import limitation. Fixes #3462, #2849 and #4080

As documented in #4081 [1], references to other nodes are not valid
when the NodeAddedEvent is invoked during the import of a scene in
an existing scene.

This prevented the qMRMLSceneModel from working well when it is
observing the scene and updating itself as new node are added
during import.

This commit workarounds the root issue by forcing all SceneModel
to have "lazyUpdate" enabled.

When lazyUpdate is enabled, the model ignores added node events when the
scene is importing/restoring, but synchronize with the scene once its
imported/restored.

This affected a broad set of modules and was captured in the following
issues:

* 3462: ModelMaker functionality breaks display of Slice views
* 2849: Hierachy not respected when loading the same scene multiples times
* 4080: Transform module is not updated properly after importing a scene

Reviewed-by: Andras Lasso <lasso@queensu.ca>
Reviewed-by: Steve Pieper <pieper@isomics.com>
Tested-by: Andras Lasso <lasso@queensu.ca>
Tested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24718  Directory Listing
Modified Tue Nov 10 10:35:36 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: MRMLNodeTest1: Add test for CopyWithScene() node method. See #3462

It allowed to identify the following unsupported case:

Calling CopyWithScene after the copied node has been added
to the scene will be problematic. In that case, (a) the source
and copied node will end up having the same ID and (b) the scene
cache and reference list won't be up-to-date either.

This is explained because the method CopyWithScene systematically
copy the nodeID from the source node without asking the scene
to generate a new one if the scene is set.

Issue #4078 has been created to keep track of the problem.

Revision 24717  Directory Listing
Modified Tue Nov 10 10:35:35 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: MRMLCoreTestingUtilities: Improve output of CheckNodeInSceneByID

This commit updates the method to also display the node IDs.

Revision 24714  Directory Listing
Modified Mon Nov 9 21:20:47 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: Add TestImportSceneReferenceValidDuringImport node tests. See #3462

This test ensures that import of scenes with regular nodes, hierarchy nodes
and storable nodes work as expected.

It will later be extended to test that references are valid after each
NodeAddedEvent.

Revision 24713  Directory Listing
Modified Mon Nov 9 21:20:46 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: MRMLScene: Improve readability of "UpdateNodeReferences" function

This commit simply adds the intermediate ivars oldID and newID

Revision 24712  Directory Listing
Modified Mon Nov 9 21:20:44 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: Improve SceneImportIDModelHierarchyParentIDConflictTest error reporting

By having every tests explicitly specifying the line, current and expected
values. It is easier and faster to identify the test that failed.

Revision 24711  Directory Listing
Modified Mon Nov 9 21:20:42 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: Improve SceneImportIDModelHierarchyConflictTest error reporting

By having every tests explicitly specifying the line, current and expected
values. It is easier and faster to identify the test that failed.

Revision 24710  Directory Listing
Modified Mon Nov 9 21:20:41 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: Improve vtkMRMLSceneImportIDConflictTest error reporting

By having every tests explicitly specifying the line, current and expected
values. It is easier and faster to identify the test that failed.

Revision 24709  Directory Listing
Modified Mon Nov 9 21:20:39 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: MRMLNodeTest1: Refactor TestNodeReferenceSerialization

This commit introduces the convenience function "CheckNotNull()" and
re-organize the test to facilitate interpretation of a failure. It will
now clearly display which function call failed and what are the current
and expected values.

Revision 24708  Directory Listing
Modified Mon Nov 9 21:20:38 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: Refactor tests introducing  vtkMRMLCoreTestingUtilities

This module provides functions to facilitate writing tests.

The module itself is tested to ensure the utilities
function detect failing condition correctly.

Revision 24705  Directory Listing
Modified Sat Nov 7 04:36:26 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: MRMLScene: Refactor to use existing "AddNodeID()" function

Revision 24704  Directory Listing
Modified Sat Nov 7 04:36:24 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: vtkMRMLScene: Refactor code introducing IsReservedID() function.

Revision 24702  Directory Listing
Modified Sat Nov 7 04:36:20 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: vtkMRMLNodeTest1: Prepend "Line " in error message.

This change will allow to more easily identify the line associated
with the failing test.

Instead of having an output of the form:

  50: 30: TestSomething failed
  50: Something went wrong
  1/1 Test #50: vtkMRMLNodeTest1 .................***Failed    1.12 sec

where the "50:" and the "30:" are hard to distinguish.

This commit changes the output into:

  50: Line 30: TestSomething failed
  50: Something went wrong
  1/1 Test #50: vtkMRMLNodeTest1 .................***Failed    1.12 sec

Revision 24701  Directory Listing
Modified Sat Nov 7 04:36:18 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: MRMLScene: Remove non-implemented function GetTransformBetweenNodes()

This commit removes function GetTransformBetweenNodes() originally
introduced in r40 (COMP: added vtkITK and MRML libs) but never
implemented.

Revision 24700  Directory Listing
Modified Sat Nov 7 04:36:16 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: MRMLScene: Improve readability adding function IsNodeWithoutName()

Revision 24699  Directory Listing
Modified Sat Nov 7 04:36:13 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: MRMLScene: Improve readability adding local function IsNodeWithoutID()

Revision 24697  Directory Listing
Modified Sat Nov 7 04:36:10 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: Improve code readability in qMRMLSceneDisplayableModel

Use downcast-ed variable "displayableNode" instead of "node", it
unambiguously describes what the code is doing.

Revision 24696  Directory Listing
Modified Sat Nov 7 04:36:08 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: Simplify code in qMRMLSceneDisplayable removing extra ivar

Revision 24695  Directory Listing
Modified Sat Nov 7 04:36:06 2015 UTC (22 months, 2 weeks ago) by jcfr
STYLE: vtkMRMLSelectionNode: Fix typo in variable name.

Revision 24688  Directory Listing
Modified Tue Nov 3 04:52:00 2015 UTC (22 months, 3 weeks ago) by jcfr
BUG: Fixed transform splitting. Fixes #4073

Fixes https://www.na-mic.org/Mantis/view.php?id=4073

Problem was that when a composite transform contained an inverse
linear transform, the inverse transform was used as transformToParent.
When transformToParent was later modified by the transform sliders on
the GUI, transformToParent was updated, but transformFromParent was
unchanged.

Script to reproduce the issue:

t1=vtk.vtkTransform()
m1=vtk.vtkMatrix4x4()
m1.SetElement(0,3,15)
t1.SetMatrix(m1)
t2=t1.GetInverse()
print t1.GetMatrix()
print t1.GetInverseFlag()
print t2.GetMatrix() # this is required, otherwise the behavior will not be inconsistent
print t2.GetInverseFlag()
t2.Inverse() # editing the inverse transform
print t1.GetMatrix() # returns ... 15 ...
print t1.GetInverseFlag() # returns 0
print t2.GetMatrix() # returns ... 15 ...
print t2.GetInverseFlag() # returns 0
0 on both and the matrix values are the same.

It seems that if a computed inverse transform is modified then the
transform pipeline becomes inconsistent. It may be the expected behavior
in VTK, one should simply never modify a computed transform. I'll confirm
this with David Gobbi.

The solution was to always set the forward transform in the node so that
when it is modified, it updates the inverse transform as well.

Tested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Andras Lasso <lasso@queensu.ca>

Revision 24681  Directory Listing
Modified Fri Oct 30 17:44:58 2015 UTC (22 months, 3 weeks ago) by jcfr
BUG: Fix doubleArrayStorageNode Reader return value

Corrects typo returning wrong value at the end of ReadData.

It is now returning 0 if the DoubleArray is empty. This is
not a usual behavior as we should allow reading an empty
node, but we are doing this for backward compatibility with
the behavior prior to r24675 (BUG: Fix support for missing
labels in vtkMRMLDoubleArrayStorage reader) [1].

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Libs/MRML/Core/vtkMRMLDoubleArrayStorageNode.cxx?revision=23021&view=markup&pathrev=24674#l200

This fixes those two failing tests:
(1) vtkSlicerDoubleArraysLogicAddFileTest
(2) vtkMRMLDoubleArrayNodeTest1

//----------
$ ctest -R "DoubleArray[s]?(Logic|Node)"
Test project /home/jcfr/Projects/Slicer-Debug/Slicer-build
    Start  25: vtkMRMLDoubleArrayNodeTest1
1/2 Test  #25: vtkMRMLDoubleArrayNodeTest1 .............   Passed    0.95 sec
    Start 326: vtkSlicerDoubleArraysLogicAddFileTest
2/2 Test #326: vtkSlicerDoubleArraysLogicAddFileTest ...   Passed    1.19 sec
//----------

Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Alexis Girault <alexis.girault@kitware.com>

Revision 24680  Directory Listing
Modified Fri Oct 30 17:44:56 2015 UTC (22 months, 3 weeks ago) by jcfr
STYLE: Improve vtkMRMLDoubleArrayNodeTest1

By improving this test we can deduce that ReadData
does not work appropriately since it returns 0 even
though the file is correctly read.

This is the same error that makes the test below fail :
'vtkSlicerDoubleArraysLogicAddFileTest', as shown
in PR #392

Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
and on CDash: http://slicer.cdash.org/testDetails.php?test=6885663&build=700523

From: Alexis Girault <alexis.girault@kitware.com>

Revision 24676  Directory Listing
Modified Thu Oct 29 07:13:19 2015 UTC (22 months, 4 weeks ago) by jcfr
ENH: Add test for vtkMRMLDoubleArrayStorageNode reader/writer

Tests the new writer/reader as well as the reader given the
old writer convention which was assuming labels were always set.

From: Alexis Girault <alexis.girault@kitware.com>

Revision 24675  Directory Listing
Modified Thu Oct 29 07:09:23 2015 UTC (22 months, 4 weeks ago) by jcfr
BUG: Fix support for missing labels in vtkMRMLDoubleArrayStorage reader

The reader in vtkMRMLDoubleArrayStorage was always setting the
first line of values in the .mcsv file as labels. If the stored
vtkMRMLDoubleArray had not labels set, then the retrieved double
array labels would be set to the first line of numerical values,
associated with the first data point. This resulted in a missing
data point as well as shifted indices for all remaining points,
and incorrect labels.

The correction this commit offers is to write the line '# nolabels'
in the file if labels exist. If the reader finds this line, it will
set the first line of values as the first data point, instead of
setting it as label values.

Examples :

Here are four examples with (u,v,w) as labels, (12.1,425.577,-454)
for the first data point, and (8.79633e+09,0,-1) for the second one:

(1) New writer: vtkMRMLDoubleArrayNode with labels

   # measurement file filename.mcsv
   u,v,w
   12.1,425.577,-454
   8.79633e+09,0,-1

(2) New writer: vtkMRMLDoubleArrayNode with no labels set

   # measurement file filename.mcsv
   # nolabels
   12.1,425.577,-454
   8.79633e+09,0,-1

(3) Old writer: vtkMRMLDoubleArrayNode with labels

   # measurement file filename.mcsv
   # columns = x,y,yerr
   u,v,w
   12.1,425.577,-454
   8.79633e+09,0,-1

(4) Old writer: vtkMRMLDoubleArrayNode with no labels set

   # measurement file filename.mcsv
   # columns = x,y,yerr
   12.1,425.577,-454
   8.79633e+09,0,-1

Observations :

The line '# columns = x,y,yerr' was hardcoded [1] in the former
writer and had no meaning related to the actual double array
node labels. The inspiration problably came from .mcsv or .acsv
writers/readers [2][3] but had no effect here.

[1] https://github.com/Slicer/Slicer/blob/6e63b4bf5dbc65a9973160de7397dfc47882e038/Libs/MRML/Core/vtkMRMLDoubleArrayStorageNode.cxx#L244
[2] https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Markups/MRML/vtkMRMLMarkupsFiducialStorageNode.cxx#L159-L185
[3] https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationFiducialsStorageNode.cxx#L245-L268

From: Alexis Girault <alexis.girault@kitware.com>

Revision 24670  Directory Listing
Modified Wed Oct 28 23:12:35 2015 UTC (22 months, 4 weeks ago) by jcfr
ENH: Generate high-resolution magnified screenshots for 3D view. See #3885

See http://www.na-mic.org/Bug/view.php?id=3885

This commit updates the qMRMLScreenShotDialog to use the class
vtkRenderLargeImage now supporting gradient background since r24668
to do off screen magnified rendering (high resolution) of the 3D render
window when capturing screen shots.

A bug still remains for the 2D render windows in that they get tiled
by this method instead of scaled, so continue using the Qt after capture
scaling for the full view and the slice views.

Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Tested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Nicole Aucoin <nicole@bwh.harvard.edu>

Revision 24669  Directory Listing
Modified Wed Oct 28 21:27:32 2015 UTC (22 months, 4 weeks ago) by jcfr
COMP: Add ITK_OVERRIDE designations for C++11

When supported (i.e. under C++11 compiler support),
use the override designation to ensure that virtual
functions have correct signature for overriding their
parent classes.

Reviewed-by: Matt McCormick <matt.mccormick@kitware.com>
Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 24665  Directory Listing
Modified Wed Oct 28 00:12:05 2015 UTC (22 months, 4 weeks ago) by jcfr
BUG: Preserve custom color tables on scene view restore

Moving the color table information into files on disk created
a bug (analogous to the same situation with fiducials[1]) that when
a scene contains scene views that contain custom color tables
the scene view restore wipes out the colors in the color node
in the main scene. When a MRML file is read, the files on disk
are not reread to fill in scene view nodes, so the scene view
color table node is empty. This fix adds a check for if the
scene is currently restoring a scene view, and if so, don't
proceed with the copy as it will result in an color table
with the correct number of entries (as the number of colors is
saved in the MRML file) but all black and unamed.
Added a test to ensure that restoring scene views with changed
color table nodes doesn't result in a zeroed out color table,
nor a changed one (for this work around state)

[1] fiducials were fixed in this commit:
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=24376
https://github.com/Slicer/Slicer/commit/1440084bbdd9d11c1e9e1f195087f521a91af186

Issue #3992

From: Nicole Aucoin <nicole@bwh.harvard.edu>

Revision 24660  Directory Listing
Modified Sat Oct 24 06:01:04 2015 UTC (23 months ago) by jcfr
COMP: Fix "enum-compare" warning in qMRMLTransformSliders. See #4059

See http://www.na-mic.org/Bug/view.php?id=4059

Revision 24628  Directory Listing
Modified Fri Oct 16 22:34:03 2015 UTC (23 months, 1 week ago) by lassoan
ENH: Use word wrap in node info box

Node inspector became very wide when some long attributes were present. Enabled word wrapping to prevent this.

Revision 24625  Directory Listing
Modified Tue Oct 13 03:59:47 2015 UTC (23 months, 1 week ago) by lassoan
BUG: Fixed chart view crash when no data series is selected

Crash occurred when creating a chart using Label statistics module and then in the chart view deselected the data series.

Fixed crash by adding checks for the number of available data series (does not assume anymore that at least one exists).

Revision 24623  Directory Listing
Modified Fri Oct 9 12:37:40 2015 UTC (23 months, 2 weeks ago) by lassoan
BUG: Fixed default filename generation in data bundle saving

When storage node existed but filename was NULL (e.g., when created an output node and run a CLI to set it) bundle saving crashed.
Now if thefilename is NULL then it is properly set and then restored to NULL. Restoring it to NULL is important because otherwise the node file would be saved by default into a temporary directory when the user opens the save dialog.

Revision 24620  Directory Listing
Modified Thu Oct 8 05:07:53 2015 UTC (23 months, 2 weeks ago) by jcfr
COMP: Fix "pointer-bool-conversion" clang warnings in vtkMRMLDisplayNode

Slicer/Libs/MRML/Core/vtkMRMLDisplayNode.cxx:127:13: warning: address of array 'this->Color' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (this->Color)
  ~~  ~~~~~~^~~~~
Slicer/Libs/MRML/Core/vtkMRMLDisplayNode.cxx:136:13: warning: address of array 'this->SelectedColor' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (this->SelectedColor)
  ~~  ~~~~~~^~~~~~~~~~~~~

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 24619  Directory Listing
Modified Thu Oct 8 05:07:51 2015 UTC (23 months, 2 weeks ago) by jcfr
COMP: Fix "pointer-bool-conversion" warnings in VolumeHeaderlessStorageNode

FileDimensions and FileSpacing are not dynamically allocated, so
these pointers to arrays are always true.

Slicer/Libs/MRML/Core/vtkMRMLVolumeHeaderlessStorageNode.cxx:152:13: warning: address of array 'this->FileDimensions' will always
      evaluate to 'true' [-Wpointer-bool-conversion]
  if (this->FileDimensions)
  ~~  ~~~~~~^~~~~~~~~~~~~~
Slicer/Libs/MRML/Core/vtkMRMLVolumeHeaderlessStorageNode.cxx:158:13: warning: address of array 'this->FileSpacing' will always
      evaluate to 'true' [-Wpointer-bool-conversion]
  if (this->FileSpacing)
  ~~  ~~~~~~^~~~~~~~~~~

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 24618  Directory Listing
Modified Thu Oct 8 05:07:49 2015 UTC (23 months, 2 weeks ago) by jcfr
COMP: Fix "tautological-undefined-compare" clang warning in vtkMRMLScene

Slicer/Libs/MRML/Core/vtkMRMLScene.cxx:1707:7: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to false [-Wtautological-undefined-compare]
  if (this == NULL)
      ^~~~    ~~~~

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 24617  Directory Listing
Modified Thu Oct 8 05:07:47 2015 UTC (23 months, 2 weeks ago) by jcfr
COMP: Fix "undefined-bool-conversion" clang warnings in vtkMRMLScene

Slicer/Libs/MRML/Core/vtkMRMLScene.cxx:533:9: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
  if ( !this )
       ~^~~~
Slicer/Libs/MRML/Core/vtkMRMLScene.cxx:1492:9: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
  if ( !this || !this->Nodes)
       ~^~~~

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 24616  Directory Listing
Modified Thu Oct 8 05:07:44 2015 UTC (23 months, 2 weeks ago) by jcfr
COMP: Fix "pointer-bool-conversion" warning in vtkFSSurfaceAnnotationReader

Fix the warning by managing "ColorTableFileName" similarly to how "FileName"
is managed in vtkMRMLStorageNode.

Suggested-by: Hans Johnson <hans-johnson@uiowa.edu>

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24614  Directory Listing
Modified Wed Oct 7 23:54:13 2015 UTC (23 months, 2 weeks ago) by jcfr
ENH: Add test for vtkMRMLDoubleArrayNode set/get methods

From: Alexis Girault <alexis.girault@kitware.com>

Revision 24613  Directory Listing
Modified Wed Oct 7 23:50:27 2015 UTC (23 months, 2 weeks ago) by jcfr
ENH: Improve vtkMRMLDoubleArrayNode set/get methods

Until now vtkMRMLDoubleArrayNode values could only be obtained using
'GetXYValue(int, double*, double*)', by passing the index and pointers
to doubles. In python such a method can not be wrapped if it passes
pointers. Within VTK classes such methods are wrapped but the mechanism
is not available to external classes [1][2].

[1] http://www.vtk.org/Wiki/VTK/Python_Wrapper_Enhancement#GetTuple.2FSetTuple_.28done_as_of_Aug_6.2C_2010.29
[2] https://github.com/Kitware/VTK/blob/077fcb394f32c76b4c05a2456b61d000563a19d5/Wrapping/Tools/vtkWrap.c#L661-L697

To overcome this limitation, this commit adds:
(1) the methods 'GetValues', 'SetValues' and 'AddValues', that are
managing the whole vectors of components for each datapoint or the
array (not just XY or XYZ)
(2) the methods 'GetValue', 'SetValue' and 'Addvalue' in order to
retrieve/set/add values not just defined by the datapoint index, but
also by the component index. These methods are conveniently wrapped
in python.

The former set/get methods limited to XY values, as well as the new
methods dealing with only one component value, are based on the methods
managing the entire datapoint vectors.

This commit also applies more robust conditions on the index and the
component number.

Rational :

We were interested in creating this method for vtkMRMLDoubleArrayNode
because this node can be used to transfer double vectors between CLIs
and Slicer [3]. The needs we had were :
(1) Getting the returned values in a python module running the CLIs
(2) Being able to get a specified component (not limited to X and Y)

[3] https://github.com/Slicer/Slicer/blob/866900a/Modules/CLI/ExecutionModelTour/ExecutionModelTour.xml#L183-L19

This commit offers features that can greatly facilitate the exchange
of numerical values between Slicer and the CLI modules.

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Alexis Girault <alexis.girault@kitware.com>

Revision 24608  Directory Listing
Modified Wed Oct 7 02:55:56 2015 UTC (23 months, 2 weeks ago) by jcfr
BUG: Do not reset reference when importing scene. Fixes #4040

This commit fixes a regression introduced in r24393 [1] where a node and its
referenced nodes would be modified if node with the same ID were imported.

The issue is due to the MRML scene being set to the node just before the
function "ReadXMLAttributes()" is called in "vtkMRMLParser::StartElement".

Indeed, since within "ReadXMLAttributes()", the method "AddNodeReferenceID()"
is called, when the ID of a node being imported conflicts with an existing
one in the scene, it causes the existing node to be updated. For example,
this problem is observed in test where a conflicting "vtkMRMLDisplayableNode"
is imported.

Other approach could be to ensure no events are invoked in the method
"vtkMRMLDisplayableNode::OnNodeReferenceAdded" when scene is being
imported.

[1] r24393 - BUG: remove node SceneRootDir, use RootDirectory on MRML scene

Co-authored-by: Nicole Aucoin <nicole@bwh.harvard.edu>

Revision 24605  Directory Listing
Modified Tue Oct 6 13:12:08 2015 UTC (23 months, 2 weeks ago) by jcfr
BUG: Fix vtkITKTransformConverter to support future ITK >= 4.8.1

Anticipating transition to newer version of ITK, this commit fixes
a build error (most likely copy-n-paste error) originally introduced in
r24338 (ENH: Backwards compatible FixedParameters) by changing
"FixedParametersValueType" into "FixedParametersType" to consider ITK
change InsightSoftwareConsortium/ITK@3592834 (BUG: FixedParameters
should be double precision)

Tested-by: Hans Johnson <hans-johnson@uiowa.edu>

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 24597  Directory Listing
Modified Mon Oct 5 03:49:36 2015 UTC (23 months, 3 weeks ago) by jcfr
STYLE: Simplify code in ImportIDModelHierarchyConflictTest. See #4040

Revision 24596  Directory Listing
Modified Mon Oct 5 03:49:34 2015 UTC (23 months, 3 weeks ago) by jcfr
STYLE: Display line number in ImportIDModelHierarchyConflictTest error message

See #4040

Revision 24585  Directory Listing
Modified Tue Sep 29 22:33:16 2015 UTC (23 months, 3 weeks ago) by naucoin
BUG: update the baseline mrml file for singleton changes

Add the singleton tag to the baseline mrml file for the
camera displayable manager test.

Issue #4006

Revision 24582  Directory Listing
Modified Tue Sep 29 20:55:06 2015 UTC (23 months, 3 weeks ago) by naucoin
ENH: serialise singleton tags

Singleton nodes were not having their singleton tag serialised to MRML,
so on loading a scene back in, two nodes would be present in the scene
if the node logic is relying on the tag to update the originally in
the scene node.
This fix serialised the singleton tag to MRML, adds a utility method
to uniformly turn the property on or off, adds a test, and expands
the node documentation to note that the hack in the scene to get
untagged singleton nodes is needed for legacy scene files. Also
gave examples for the conventions for singleton tag strings
in the mrml node header file.

Issue #4006

Revision 24579  Directory Listing
Modified Fri Sep 25 14:57:16 2015 UTC (2 years ago) by alexy
ENH: Tractography Display performance improvement: Don't query invisible display nodes, which caused glyphs and tubes to recompute even if they are not visible.

Revision 24578  Directory Listing
Modified Fri Sep 25 14:55:04 2015 UTC (2 years ago) by msmolens
BUG: Fix memory leaks when saving scene fails

This commit replaces manual memory management with smart pointers to fix memory
leaks in vtkITKImageWriter::Write() when an exception occurs while writing the
image.

Fixes issue #3717:

    To reproduce:
     -> Create folder ~/test
     -> Start Slicer
     -> Download MRHead
     -> File -> Save Scene
     -> Click "Change directory for selected files" and select "~/test"
     -> after selecting the folder and before clicking Save => chmod -w ~/test
     -> Click Save
     -> When you get the "Cannot write data file" error, click Yes to say you want to continue despite the problem
     -> When you get the "Cannot write scene file" error, click Yes to say you ignore these errors and close saving
     -> Close Slicer (click Exit and discard modification)

    Then, you get the following leaks:

    Class "vtkCellData" has 1 instance still around.
    Class "vtkInformationIntegerVectorValue" has 3 instances still around.
    Class "vtkInformationVector" has 15 instances still around.
    Class "vtkPointData" has 1 instance still around.
    Class "vtkImageFlip" has 1 instance still around.
    Class "vtkTrivialProducer" has 1 instance still around.
    Class "vtkMatrix4x4" has 1 instance still around.
    Class "vtkPoints" has 1 instance still around.
    Class "vtkInformation" has 21 instances still around.
    Class "vtkMultiThreader" has 1 instance still around.
    Class "vtkInformationIntegerPointerValue" has 2 instances still around.
    Class "vtkIdList" has 1 instance still around.
    Class "vtkImageExport" has 1 instance still around.
    Class "vtkDoubleArray" has 1 instance still around.
    Class "vtkAlgorithmOutput" has 1 instance still around.
    Class "vtkImageStencilData" has 1 instance still around.
    Class "vtkInformationIntegerValue" has 26 instances still around.
    Class "vtkExtentTranslator" has 1 instance still around.
    Class "vtkImageData" has 1 instance still around.
    Class "vtkInformationStringValue" has 1 instance still around.
    Class "vtkInformationExecutivePortVectorValue" has 1 instance still around.
    Class "vtkShortArray" has 1 instance still around.
    Class "vtkVoxel" has 1 instance still around.
    Class "vtkFieldData" has 2 instances still around.
    Class "vtkInformationDoubleVectorValue" has 2 instances still around.
    Class "vtkStreamingDemandDrivenPipeline" has 3 instances still around.
    Class "vtkInformationExecutivePortValue" has 4 instances still around.

From: Max Smolens <max.smolens@kitware.com>

Revision 24571  Directory Listing
Modified Tue Sep 22 15:31:31 2015 UTC (2 years ago) by msmolens
BUG: Fix libpng warnings in console when loading images with Qt 4.8.7

This commit eliminates the following libpng warning seen when loading certain
PNG images using libpng 1.6.x, which is included in Qt 4.8.7:

    libpng warning: iCCP: known incorrect sRGB profile

To fix the images I ran them through ImageMagick, which removes the incorrect
profiles, as suggested in [1]:

    convert image.png image.png

libpng 1.6.17 describes the warning in png.c line 2308:

    /* These profiles are known to have bad data that may cause
     * problems if they are used, therefore attempt to
     * discourage their use, skip the 'have_md5' warning below,
     * which is made irrelevant by this error.
     */

[1] http://stackoverflow.com/questions/22745076/libpng-warning-iccp-known-incorrect-srgb-profile

From: Max Smolens <max.smolens@kitware.com>

Revision 24567  Directory Listing
Modified Mon Sep 21 21:08:31 2015 UTC (2 years ago) by pinter
ENH: Allow multi-selection in subject hierarchy.

Drag&drop and deletion of multiple nodes are now possible with one operation. All the context menu actions other than Delete become unavailable when multiple nodes are selected, but is still available with a single node. DICOM references are also highlighted for each selected node.
Related to https://www.assembla.com/spaces/slicerrt/tickets/620

Revision 24566  Directory Listing
Modified Mon Sep 21 20:18:32 2015 UTC (2 years ago) by lassoan
BUG: Fixed compilation issue due to non-ascii character

A developer reported build issue due to presence of the "degree" character (0xb0).

Revision 24555  Directory Listing
Modified Wed Sep 16 20:47:36 2015 UTC (2 years ago) by lassoan
BUG: Made grid transform writing more robust

Float and double grids can be saved (earlier floats were not supported and Slicer could crash when attempted)
To/From parent transform can be saved as well (earlier inverse transform saving was not working when the inverse transform had never been used before)

Revision 24546  Directory Listing
Modified Tue Sep 15 22:40:18 2015 UTC (2 years ago) by jcfr
BUG: Finalize transition to ITK MGH IO fixing mgh test. See #3410

Fix failing test py_nomainwindow_test_slicer_mgh.

This commit fixes a regression introduced by r24539 (ENH: Convert to
using ITK version of MGHIO ) by explicitly adding MGHIO to list of IO
modules that should be loaded by ITKFactoryRegistration library.

Thanks: Bradley Lowekamp <blowekamp@mail.nih.gov>

Revision 24541  Directory Listing
Modified Mon Sep 14 22:16:13 2015 UTC (2 years ago) by jcfr
BUG: MRMLUnitNode: Ensure value to string conversion account for precision

Fixes #4044

By calling "strstream.setf(ios::fixed,ios::floatfield)", it guarantees
that the returned string will have a number of decimals equal to the
precision (instead of a number of digit equal to precision).

This prevents the cut of decimals when we have big numbers.

Running the following python snippet in the python interactor
before and after integrating this commit illustrates the problem
and confirm it is fixed.

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
import math
l = slicer.modules.units.logic()
s = l.GetUnitsScene()
n = s.GetNodesByName("Metre per second").GetItemAsObject(0)
n.SetPrecision(3)
for v in range(-5, 5):
  print("10^%d -> %s" % (v, n.GetDisplayStringFromValue(math.pow(10, v))))
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---

Before the change:

10^-5 ->  1e-05 m/s
10^-4 ->  0.0001 m/s
10^-3 ->  0.001 m/s
10^-2 ->  0.01 m/s
10^-1 ->  0.1 m/s
10^0 ->  1 m/s
10^1 ->  10 m/s
10^2 ->  100 m/s
10^3 ->  1e+03 m/s
10^4 ->  1e+04 m/s

After the change:

10^-5 ->  0.000 m/s
10^-4 ->  0.000 m/s
10^-3 ->  0.001 m/s
10^-2 ->  0.010 m/s
10^-1 ->  0.100 m/s
10^0 ->  1.000 m/s
10^1 ->  10.000 m/s
10^2 ->  100.000 m/s
10^3 ->  1000.000 m/s
10^4 ->  10000.000 m/s

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Davide Punzo <punzodavide@hotmail.it>

Revision 24539  Directory Listing
Modified Mon Sep 14 21:04:20 2015 UTC (2 years ago) by jcfr
ENH: Convert to using ITK version of MGHIO

The ITK supplied version of MGHIO is a derivative
work that originated in Slicer.  The ITK version
has more widespread use in non-slicer envirnments and
can be used and maintained by a larger community.

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 24534  Directory Listing
Modified Sun Sep 13 03:42:54 2015 UTC (2 years ago) by jcfr
STYLE: Fix doxygen in vtkMRMLUnitNode.h

From: Davide Punzo <punzodavide@hotmail.it>

Revision 24516  Directory Listing
Modified Wed Sep 2 12:25:15 2015 UTC (2 years ago) by lassoan
BUG: Fixed transform translation slider instability in rotate first mode

How to reproduce the problem:
1. Create a new Transform
2. Switch to 'rotate first' mode (pushbutton pressed)
3. Drag the LR translation slider to 200
4. Drag the AP slider to 1 and back to 0
5. Drag the LR translation slider to the rightmost position
=> ERROR: the translation jumps to tens of thousands (instead of the expected 400)

Fix: Don't update the translation slider range if in 'rotate first' mode. Set the matrix range to a fixed large value to allow larger translation values in the matrix than the slider range.

Revision 24506  Directory Listing
Modified Tue Aug 25 20:13:54 2015 UTC (2 years, 1 month ago) by pieper
BUG: Make sure display nodes are observed before adding model to scene

This caused a subtle bug reported by Beatriz Paniagua.
Sequence to reproduce before this change:
* start fresh slicer
* make green slice visible (it appears)
* close scene
* make green slice visible (BUG: it does not appear)
* perform any other operation that changes the 3D view, green slice appears

Note that the issue only happened with the green slice model,
which importantly is the last one on the list.

Issue was because all slice models where observing their
display nodes *after* being added to the scene, meaning that
the displayable manager saw no display node on the model nodes
when it got the node added event for the model node and therefore
did not observe the node.  Other slice model nodes did not exhibit
this issue because they were being refreshed when other nodes
were added to the scene.

Revision 24502  Directory Listing
Modified Wed Aug 19 03:22:15 2015 UTC (2 years, 1 month ago) by lassoan
BUG: Fixed crash caused in Model display node widget

Slicer crashed when updated a filter pipeline that generated a polydata that was used by the model node.

There was an infinite loop (and stack overflow) caused by automatically selecting the first scalar attribute when the polydata is regenerated by the pipeline.

Fixed by allowing having 'none' selected as displayed scalar in the model widget and therefore avoiding automatic scalar selection when scalars are added to the data set and so avoiding infinite loop.

Revision 24499  Directory Listing
Modified Fri Aug 14 21:33:34 2015 UTC (2 years, 1 month ago) by lassoan
BUG: Fixed inverse TPS transform saving

Basis function type check failed when trying to save inverse transforms

Revision 24493  Directory Listing
Modified Tue Aug 11 23:09:33 2015 UTC (2 years, 1 month ago) by naucoin
ENH: check for data that will get deleted on scene view restore

Added a flag to the scene view node restore call that will cancel if
any nodes come up as being in the main Slicer scene but not in the
scene view scene about to be restored.
Added a method to add nodes to the scene view scene that are in the
main Slicer scene but not in the scene view.
Updated the GUI for restoring scenes via the tool bar and the Scene
Views module to pop up message boxes to give the user options to
discard the data, add it to the scene view, or cancel the restore.
Updated the test to include a failure case when removing nodes
is not allowed.
Unify scene view node to use SafeDownCast instead of a mix of
dynamic_cast and SafeDownCast.

Issue #3956

Revision 24486  Directory Listing
Modified Wed Aug 5 18:39:13 2015 UTC (2 years, 1 month ago) by pinter
STYLE: Replaced assert to logging error in labelmap volume display node

Revision 24481  Directory Listing
Modified Tue Aug 4 03:43:52 2015 UTC (2 years, 1 month ago) by jcfr
STYLE: Remove erroneous comments in vtkMRMLVolumeNode.cxx

This commit removes incorrect comment originally introduced
in r23524 (BUG: Propagate ModifiedEvent to volume/modelNode)

From: Adam Rankin <adam.rankin@gmail.com>

Revision 24480  Directory Listing
Modified Tue Aug 4 03:43:50 2015 UTC (2 years, 1 month ago) by jcfr
STYLE: Remove obsolete comments in vtkMRMLVolumeNode.h

Clean-up comment that became obsolete following refactoring
done in r3955 (ENH: made Volume and Model nodes derived from
vtkMRMLDisplayableNode)

From: Adam Rankin <adam.rankin@gmail.com>

Revision 24477  Directory Listing
Modified Tue Aug 4 02:41:50 2015 UTC (2 years, 1 month ago) by jcfr
COMP: Fix some compilation errors in Visual Studio 2013

Compiles in Debug configuration as long as EMSegment module, numpy and
OpenSSL support disabled.

Errors fixed by changes in vtkMRMLCoreTestingMacros are similar to the
following:

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
Error   2   error C2678: binary '<<' : no operator found which takes a left-hand operand of type 'std::basic_ostream<char,std::char_traits<char>>' (or there is no acceptable conversion)   C:\dev\Slicer\Libs\MRML\Core\Testing\vtkMRMLDiffusionTensorVolumeDisplayNodeTest1.cxx   24
Error   3   error C2088: '<<' : illegal for class   C:\dev\Slicer\Libs\MRML\Core\Testing\vtkMRMLDiffusionTensorVolumeDisplayNodeTest1.cxx   24
Error   4   error C2678: binary '<<' : no operator found which takes a left-hand operand of type 'std::basic_ostream<char,std::char_traits<char>>' (or there is no acceptable conversion)   C:\dev\Slicer\Libs\MRML\Core\Testing\vtkMRMLDiffusionWeightedVolumeDisplayNodeTest1.cxx 23
Error   5   error C2088: '<<' : illegal for class   C:\dev\Slicer\Libs\MRML\Core\Testing\vtkMRMLDiffusionWeightedVolumeDisplayNodeTest1.cxx 23
[...]
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---

From: Max Smolens <max.smolens@kitware.com>

Revision 24476  Directory Listing
Modified Tue Aug 4 02:41:47 2015 UTC (2 years, 1 month ago) by jcfr
STYLE: Add convenience camera node method "SetViewUp(vx, vy, vz)"

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24459  Directory Listing
Modified Tue Jul 21 21:13:45 2015 UTC (2 years, 2 months ago) by naucoin
ENH: support fiducial file transfer between Slicer and CLIs

Requires the updates to the SlicerExecutionModel to define the new XML
tag --pointfile, the pull request was merged, so the external project
file is updated.
Expands the application logic to support reading and writing fiducial files.
Expands the CLI module UI helper to create a fiducial node selection combo
box when a point file type is detected.
Expands the CLI module logic to manage fiducial files. Need to link to the
Markups storage node to set the coordinate system flag, and to remove a circular
dependency between the Markups Module and QTCLI, moved that class into Libs MRML Core.
Currently setting an attribute on the fiducial node to pass the coordinate
system flag along to ApplyTask where the files get written to disk.
Added CreateDefaultDisplayNodes for the fiducial node so it can be called for
output node setup.
Add input and output fiducial file examples with coordinate
systems set to LPS to the execution model tour.

Revision 24454  Directory Listing
Modified Fri Jul 17 15:34:54 2015 UTC (2 years, 2 months ago) by jcfr
BUG: Fix vtkMRMLColorTableNodeTest1

Following r24436 (BUG: Fix uninitialized value in vtkMRMLColorTableNode.),
the property "NamesInitialised" is not explicitly set when calling
"SetColor()".

This commit explicitly calls "NamesInitialisedOn()" after setting the color.

Revision 24453  Directory Listing
Modified Fri Jul 17 15:34:52 2015 UTC (2 years, 2 months ago) by jcfr
STYLE: Improve output of vtkMRMLColorTableNodeTest1 displaying line number

Revision 24451  Directory Listing
Modified Fri Jul 17 06:51:14 2015 UTC (2 years, 2 months ago) by jcfr
BUG: Fix memory leak in vtkMRMLScene

This commit fixes the error(s) reported below by valgrind memcheck tool.

Valgrind was used on Ubuntu 14.04 against a Debug build of Slicer. It was
executed doing the following:
 (1) Start a terminal with the appropriate environment: ./Slicer --gnome-terminal
 (2) Run vtkMRMLSceneImportIDModelHierarchyConflictTest using using valgrind: valgrind --tool=memcheck --leak-check=yes ./bin/MRMLCoreCxxTests  vtkMRMLSceneImportIDModelHierarchyConflictTest

Valgrind error:

==17319== 18 bytes in 2 blocks are definitely lost in loss record 98 of 240
==17319==    at 0x4C2B800: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==17319==    by 0x52DAB7D: vtkMRMLScene::SetLastLoadedVersion(char const*) (in /home/jcfr/Projects/Slicer-Debug/Slicer-build/bin/libMRMLCore.so)
==17319==    by 0x52A9C29: vtkMRMLParser::StartElement(char const*, char const**) (vtkMRMLParser.cxx:47)
==17319==    by 0x1A9BAC12: vtkXMLParserStartElement (vtkXMLParser.cxx:523)
==17319==    by 0x1BE5A943: doContent (xmlparse.c:1641)
==17319==    by 0x1BE59A10: contentProcessor (xmlparse.c:1331)
==17319==    by 0x1BE5DCEF: doProlog (xmlparse.c:2669)
==17319==    by 0x1BE5D48F: prologProcessor (xmlparse.c:2505)
==17319==    by 0x1BE5D41C: prologInitProcessor (xmlparse.c:2494)
==17319==    by 0x1BE592C2: vtk_expat_XML_ParseBuffer (xmlparse.c:1132)
==17319==    by 0x1BE59218: vtk_expat_XML_Parse (xmlparse.c:1122)
==17319==    by 0x1A9BAB4C: vtkXMLParser::ParseBuffer(char const*, unsigned int) (vtkXMLParser.cxx:496)

Revision 24449  Directory Listing
Modified Fri Jul 17 06:51:10 2015 UTC (2 years, 2 months ago) by jcfr
BUG: Fix uninitialized value issue in qMRMLTransformSliders

This commit fixes the error(s) reported below by valgrind memcheck tool.

Valgrind was used on Ubuntu 14.04 against a Debug build of Slicer. It was
executed doing the following:
 (1) Start a terminal with the appropriate environment: ./Slicer --gnome-terminal
 (2) Start Slicer using valgrind: valgrind --log-file=2015-07-16-Slicer-memcheck.txt --tool=memcheck --leak-check=yes ./bin/SlicerApp-real --disable-python
 (3) Load MRHead.nrrd file
 (4) Exit Slicer and inspect valgrind log file

Valgrind error:

==1972== Conditional jump or move depends on uninitialised value(s)
==1972==    at 0x5EB79E1: qMRMLTransformSliders::setTypeOfTransform(qMRMLTransformSliders::TransformType) (qMRMLTransformSliders.cxx:131)
==1972==    by 0x5EB753C: qMRMLTransformSliders::qMRMLTransformSliders(QWidget*) (qMRMLTransformSliders.cxx:71)
==1972==    by 0x10930B917: Ui_qSlicerTransformsModuleWidget::setupUi(qSlicerWidget*) (ui_qSlicerTransformsModuleWidget.h:163)
==1972==    by 0x109307D16: qSlicerTransformsModuleWidget::setup() (qSlicerTransformsModuleWidget.cxx:117)
==1972==    by 0x8E83A6A: qSlicerAbstractModuleRepresentation::setModule(qSlicerAbstractCoreModule*) (qSlicerAbstractModuleRepresentation.cxx:82)
==1972==    by 0x8E73522: qSlicerAbstractCoreModule::createNewWidgetRepresentation() (qSlicerAbstractCoreModule.cxx:258)
==1972==    by 0x8E733BB: qSlicerAbstractCoreModule::widgetRepresentation() (qSlicerAbstractCoreModule.cxx:226)
==1972==    by 0x59554F6: qSlicerModulePanel::addModule(qSlicerAbstractCoreModule*) (qSlicerModulePanel.cxx:145)
==1972==    by 0x595547C: qSlicerModulePanel::setModule(qSlicerAbstractCoreModule*) (qSlicerModulePanel.cxx:131)
==1972==    by 0x59553BB: qSlicerModulePanel::setModule(QString const&) (qSlicerModulePanel.cxx:109)
==1972==    by 0x59B025B: qSlicerModulePanel::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qSlicerModulePanel.cxx:53)
==1972==    by 0x20AE9DC9: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (in /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtCore.so.4.8.6)

Revision 24448  Directory Listing
Modified Fri Jul 17 06:51:08 2015 UTC (2 years, 2 months ago) by jcfr
BUG: Fix uninitialized value issue in vtkNRRDReader

This commit fixes the error(s) reported below by valgrind memcheck tool.

Valgrind was used on Ubuntu 14.04 against a Debug build of Slicer. It was
executed doing the following:
 (1) Start a terminal with the appropriate environment: ./Slicer --gnome-terminal
 (2) Start Slicer using valgrind: valgrind --log-file=2015-07-16-Slicer-memcheck.txt --tool=memcheck --leak-check=yes ./bin/SlicerApp-real --disable-python
 (3) Load MRHead.nrrd file
 (4) Exit Slicer and inspect valgrind log file

Valgrind error:

==581== Conditional jump or move depends on uninitialised value(s)
==581==    at 0x1E7585AF: vtkNRRDReader::SetPointDataType(int) (in /home/jcfr/Projects/Slicer-Debug/Slicer-build/bin/libvtkTeem.so)
==581==    by 0x1E74F0FF: vtkNRRDReader::ExecuteInformation() (vtkNRRDReader.cxx:346)
==581==    by 0x23AD4531: vtkImageReader2::RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkImageReader2.cxx:484)
==581==    by 0x291481B8: vtkImageAlgorithm::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkImageAlgorithm.cxx:109)
==581==    by 0x2913BB9B: vtkExecutive::CallAlgorithm(vtkInformation*, int, vtkInformationVector**, vtkInformationVector*) (vtkExecutive.cxx:775)
==581==    by 0x29134493: vtkDemandDrivenPipeline::ExecuteInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkDemandDrivenPipeline.cxx:480)
==581==    by 0x29159FCD: vtkStreamingDemandDrivenPipeline::ExecuteInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkStreamingDemandDrivenPipeline.cxx:412)
==581==    by 0x29133AF6: vtkDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkDemandDrivenPipeline.cxx:237)
==581==    by 0x29159D60: vtkStreamingDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkStreamingDemandDrivenPipeline.cxx:335)
==581==    by 0x2913407A: vtkDemandDrivenPipeline::UpdateInformation() (vtkDemandDrivenPipeline.cxx:405)
==581==    by 0x29126865: vtkAlgorithm::UpdateInformation() (vtkAlgorithm.cxx:1478)
==581==    by 0x1067960EC: vtkMRMLMultiVolumeStorageNode::ReadDataInternal(vtkMRMLNode*) (vtkMRMLMultiVolumeStorageNode.cxx:89)

Revision 24447  Directory Listing
Modified Fri Jul 17 05:01:03 2015 UTC (2 years, 2 months ago) by jcfr
BUG: Fix memory leak in vtkMRMLDisplayNode

This commit fixes the error(s) reported below by valgrind memcheck tool.

Valgrind was used on Ubuntu 14.04 against a Debug build of Slicer. It was
exected doing the following:
 (1) Start a terminal with the appropriate environment: ./Slicer --gnome-terminal
 (2) Start Slicer using valgrind: valgrind --log-file=2015-07-16-Slicer-memcheck.txt  --tool=memcheck --leak-check=yes ./bin/SlicerApp-real --disable-python --disable-cli-modules
 (3) Exit Slicer and inspect valgrind log file

Valgrind error:

==9195== 22 bytes in 1 blocks are definitely lost in loss record 407 of 2,311
==9195==    at 0x4C2B800: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9195==    by 0xE443C13: vtkMRMLDisplayNode::SetActiveScalarName(char const*) (vtkMRMLDisplayNode.cxx:38)
==9195==    by 0xE6A1650: vtkMRMLTransformDisplayNode::vtkMRMLTransformDisplayNode() (vtkMRMLTransformDisplayNode.cxx:62)
==9195==    by 0xE6A153A: vtkMRMLTransformDisplayNode::New() (vtkMRMLTransformDisplayNode.cxx:50)
==9195==    by 0xE5990EC: vtkSmartPointer<vtkMRMLTransformDisplayNode>::New() (vtkSmartPointer.h:117)
==9195==    by 0xE582342: vtkMRMLScene::vtkMRMLScene() (vtkMRMLScene.cxx:201)
==9195==    by 0xE58385A: vtkMRMLScene::New() (vtkMRMLScene.cxx:371)
==9195==    by 0x5602843: vtkNew<vtkMRMLScene>::vtkNew() (vtkNew.h:66)
==9195==    by 0x8E82E96: qSlicerCoreApplicationPrivate::init() (qSlicerCoreApplication.cxx:266)
==9195==    by 0x59272A7: qSlicerApplicationPrivate::init() (qSlicerApplication.cxx:180)
==9195==    by 0x5927FDF: qSlicerApplication::qSlicerApplication(int&, char**) (qSlicerApplication.cxx:319)
==9195==    by 0x406039: (anonymous namespace)::SlicerAppMain(int, char**) (Main.cxx:125)

Revision 24446  Directory Listing
Modified Fri Jul 17 05:01:01 2015 UTC (2 years, 2 months ago) by jcfr
BUG: Fix memory leak in vtkMRMLScene

This commit fixes the error(s) reported below by valgrind memcheck tool.

Valgrind was used on Ubuntu 14.04 against a Debug build of Slicer. It was
exected doing the following:
 (1) Start a terminal with the appropriate environment: ./Slicer --gnome-terminal
 (2) Start Slicer using valgrind: valgrind --log-file=2015-07-16-Slicer-memcheck.txt --tool=memcheck --leak-check=yes ./bin/SlicerApp-real --disable-python --disable-cli-modules
 (3) Exit Slicer and inspect valgrind log file

Valgrind error:

==9195== 12 bytes in 1 blocks are definitely lost in loss record 264 of 2,311
==9195==    at 0x4C2B800: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9195==    by 0xE596033: vtkMRMLScene::SetVersion(char const*) (in /home/jcfr/Projects/Slicer-Debug/Slicer-build/bin/libMRMLCore.so)
==9195==    by 0xE5816EE: vtkMRMLScene::vtkMRMLScene() (vtkMRMLScene.cxx:136)
==9195==    by 0xE58385A: vtkMRMLScene::New() (vtkMRMLScene.cxx:371)
==9195==    by 0x5602843: vtkNew<vtkMRMLScene>::vtkNew() (vtkNew.h:66)
==9195==    by 0x8E82E96: qSlicerCoreApplicationPrivate::init() (qSlicerCoreApplication.cxx:266)
==9195==    by 0x59272A7: qSlicerApplicationPrivate::init() (qSlicerApplication.cxx:180)
==9195==    by 0x5927FDF: qSlicerApplication::qSlicerApplication(int&, char**) (qSlicerApplication.cxx:319)
==9195==    by 0x406039: (anonymous namespace)::SlicerAppMain(int, char**) (Main.cxx:125)
==9195==    by 0x406D30: main (Main.cxx:254)
==9195==
==9195== 12 bytes in 1 blocks are definitely lost in loss record 265 of 2,311
==9195==    at 0x4C2B800: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9195==    by 0xE596033: vtkMRMLScene::SetVersion(char const*) (in /home/jcfr/Projects/Slicer-Debug/Slicer-build/bin/libMRMLCore.so)
==9195==    by 0xE5816EE: vtkMRMLScene::vtkMRMLScene() (vtkMRMLScene.cxx:136)
==9195==    by 0xE58385A: vtkMRMLScene::New() (vtkMRMLScene.cxx:371)
==9195==    by 0x10A0C2EE4: vtkSlicerUnitsLogic::vtkSlicerUnitsLogic() (vtkSlicerUnitsLogic.cxx:44)
==9195==    by 0x10A0C2E44: vtkSlicerUnitsLogic::New() (vtkSlicerUnitsLogic.cxx:39)
==9195==    by 0x109C31C11: qSlicerUnitsModule::createLogic() (qSlicerUnitsModule.cxx:156)
==9195==    by 0x8E71641: qSlicerAbstractCoreModule::logic() (qSlicerAbstractCoreModule.cxx:280)
==9195==    by 0x8E70C2D: qSlicerAbstractCoreModule::initialize(vtkSlicerApplicationLogic*) (qSlicerAbstractCoreModule.cxx:99)
==9195==    by 0x8EA2AB1: qSlicerModuleFactoryManager::loadModule(QString const&, QString const&) (qSlicerModuleFactoryManager.cxx:170)
==9195==    by 0x8EA2963: qSlicerModuleFactoryManager::loadModule(QString const&, QString const&) (qSlicerModuleFactoryManager.cxx:157)
==9195==    by 0x8EA2963: qSlicerModuleFactoryManager::loadModule(QString const&, QString const&) (qSlicerModuleFactoryManager.cxx:157)

Revision 24443  Directory Listing
Modified Fri Jul 17 05:00:55 2015 UTC (2 years, 2 months ago) by jcfr
BUG: Fix memory leak in qMRMLCheckableNodeComboBox

This commit fixes the error(s) reported below by valgrind memcheck tool.

Valgrind was used on Ubuntu 14.04 against a Debug build of Slicer. It was
exected doing the following:
 (1) Start a terminal with the appropriate environment: ./Slicer --gnome-terminal
 (2) Start Slicer using valgrind: valgrind --log-file=2015-07-16-Slicer-memcheck.txt --tool=memcheck --leak-check=yes ./bin/SlicerApp-real --disable-python --disable-cli-modules
 (3) Exit Slicer and inspect valgrind log file

Valgrind error:

==29339== 474 (32 direct, 442 indirect) bytes in 1 blocks are definitely lost in loss record 2,158 of 2,448
==29339==    at 0x4C2B0E0: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29339==    by 0x5E1AA09: qMRMLCheckableNodeComboBoxPrivate::init(QAbstractItemModel*) (qMRMLCheckableNodeComboBox.cxx:63)
==29339==    by 0x5E5E445: qMRMLNodeComboBox::qMRMLNodeComboBox(qMRMLNodeComboBoxPrivate*, QWidget*) (qMRMLNodeComboBox.cxx:399)
==29339==    by 0x5E1AB88: qMRMLCheckableNodeComboBox::qMRMLCheckableNodeComboBox(QWidget*) (qMRMLCheckableNodeComboBox.cxx:89)
==29339==    by 0x5E2E712: qMRMLDisplayNodeViewComboBox::qMRMLDisplayNodeViewComboBox(QWidget*) (qMRMLDisplayNodeViewComboBox.cxx:74)
==29339==    by 0x1046D9FDC: Ui_qSlicerMarkupsModule::setupUi(qSlicerWidget*) (ui_qSlicerMarkupsModule.h:472)
==29339==    by 0x1046C4016: qSlicerMarkupsModuleWidgetPrivate::setupUi(qSlicerWidget*) (qSlicerMarkupsModuleWidget.cxx:135)
==29339==    by 0x1046C6B55: qSlicerMarkupsModuleWidget::setup() (qSlicerMarkupsModuleWidget.cxx:464)
==29339==    by 0x8E819EA: qSlicerAbstractModuleRepresentation::setModule(qSlicerAbstractCoreModule*) (qSlicerAbstractModuleRepresentation.cxx:82)
==29339==    by 0x8E714A2: qSlicerAbstractCoreModule::createNewWidgetRepresentation() (qSlicerAbstractCoreModule.cxx:258)
==29339==    by 0x8E7133B: qSlicerAbstractCoreModule::widgetRepresentation() (qSlicerAbstractCoreModule.cxx:226)
==29339==    by 0x1046C224A: qSlicerMarkupsModule::setup() (qSlicerMarkupsModule.cxx:153)

Revision 24442  Directory Listing
Modified Fri Jul 17 05:00:53 2015 UTC (2 years, 2 months ago) by jcfr
BUG: Fix memory leak in qMRMLThreeDView removing unused code

This commit removes code most likely inadvertently added during
the refactoring done in r17602 (ENH: Add qMRMLThreeDWidget and
qMRMLThreeDViewControllerWidget)

This commit fixes the error(s) reported below by valgrind memcheck tool.

Valgrind was used on Ubuntu 14.04 against a Debug build of Slicer. It was
exected doing the following:
 (1) Start a terminal with the appropriate environment: ./Slicer --gnome-terminal
 (2) Start Slicer using valgrind: valgrind --log-file=2015-07-16-Slicer-memcheck.txt --tool=memcheck --leak-check=yes ./bin/SlicerApp-real --disable-python --disable-cli-modules
 (3) Exit Slicer and inspect valgrind log file

Valgrind error:

==29339== 4,757 (48 direct, 4,709 indirect) bytes in 1 blocks are definitely lost in loss record 2,402 of 2,448
==29339==    at 0x4C2B0E0: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29339==    by 0x5EAD8BC: qMRMLThreeDViewPrivate::init() (qMRMLThreeDView.cxx:80)
==29339==    by 0x5EAE37C: qMRMLThreeDView::qMRMLThreeDView(QWidget*) (qMRMLThreeDView.cxx:227)
==29339==    by 0x5EB59C6: qMRMLThreeDWidgetPrivate::init() (qMRMLThreeDWidget.cxx:84)
==29339==    by 0x5EB5B76: qMRMLThreeDWidget::qMRMLThreeDWidget(QWidget*) (qMRMLThreeDWidget.cxx:102)
==29339==    by 0x5E3E3C6: qMRMLLayoutThreeDViewFactory::createViewFromNode(vtkMRMLAbstractViewNode*) (qMRMLLayoutManager.cxx:76)
==29339==    by 0x5E46804: qMRMLLayoutViewFactory::onViewNodeAdded(vtkMRMLAbstractViewNode*) (qMRMLLayoutViewFactory.cxx:373)
==29339==    by 0x5E46A9A: qMRMLLayoutViewFactory::onSceneModified() (qMRMLLayoutViewFactory.cxx:423)
==29339==    by 0x5E45FD2: qMRMLLayoutViewFactory::setMRMLScene(vtkMRMLScene*) (qMRMLLayoutViewFactory.cxx:255)
==29339==    by 0x5E41C2A: qMRMLLayoutManager::setMRMLScene(vtkMRMLScene*) (qMRMLLayoutManager.cxx:838)
==29339==    by 0x4E57B4D: qSlicerAppMainWindowPrivate::setupUi(QMainWindow*) (qSlicerAppMainWindow.cxx:320)
==29339==    by 0x4E56C59: qSlicerAppMainWindowPrivate::init() (qSlicerAppMainWindow.cxx:122)

Revision 24441  Directory Listing
Modified Fri Jul 17 05:00:51 2015 UTC (2 years, 2 months ago) by jcfr
BUG: Fix memory leak in vtkMRMLLayoutNode

This commit fixes the error(s) reported below by valgrind memcheck tool.

Valgrind was used on Ubuntu 14.04 against a Debug build of Slicer. It was
exected doing the following:
 (1) Start a terminal with the appropriate environment: ./Slicer --gnome-terminal
 (2) Start Slicer using valgrind: valgrind --log-file=2015-07-16-Slicer-memcheck.txt --tool=memcheck --leak-check=yes ./bin/SlicerApp-real --disable-python --disable-cli-modules
 (3) Exit Slicer and inspect valgrind log file

Valgrind error:

==29339== 1,082 bytes in 1 blocks are definitely lost in loss record 2,290 of 2,448
==29339==    at 0x4C2B800: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29339==    by 0xE6E4563: vtkMRMLLayoutNode::SetCurrentLayoutDescription(char const*) (in /home/jcfr/Projects/Slicer-Debug/Slicer-build/bin/libMRMLCore.so)
==29339==    by 0xE6E05B0: vtkMRMLLayoutNode::SetAndParseCurrentLayoutDescription(char const*) (vtkMRMLLayoutNode.cxx:285)
==29339==    by 0xE6E04D6: vtkMRMLLayoutNode::UpdateCurrentLayoutDescription() (vtkMRMLLayoutNode.cxx:273)
==29339==    by 0xE6DFB4C: vtkMRMLLayoutNode::SetViewArrangement(int) (vtkMRMLLayoutNode.cxx:203)
==29339==    by 0x5E4212D: qMRMLLayoutManager::setLayout(int) (qMRMLLayoutManager.cxx:903)
==29339==    by 0x4E59081: qSlicerAppMainWindowPrivate::readSettings() (qSlicerAppMainWindow.cxx:490)
==29339==    by 0x4E56CDE: qSlicerAppMainWindowPrivate::init() (qSlicerAppMainWindow.cxx:127)
==29339==    by 0x4E5A98D: qSlicerAppMainWindow::qSlicerAppMainWindow(QWidget*) (qSlicerAppMainWindow.cxx:676)
==29339==    by 0x406553: (anonymous namespace)::SlicerAppMain(int, char**) (Main.cxx:184)
==29339==    by 0x406D30: main (Main.cxx:254)

Revision 24436  Directory Listing
Modified Fri Jul 17 05:00:41 2015 UTC (2 years, 2 months ago) by jcfr
BUG: Fix uninitialized value in vtkMRMLColorTableNode.

Within vtkMRMLColorTableStorageNode::ReadDataInternal(), the method
vtkMRMLColorTableNode::SetColor() is called iteratively for all entries
to initialize the color names. In the same time, within SetColor(), the
method SetNamesFromColors() is also called.

This last call to SetNamesFromColors() is the problematic one. Indeed, it
attempts to initialize the color name for all entries while color values
are being set.

Since all color names are explicitly initialized, this commit removes
the call to "SetNamesFromColors()" from "SetColor()" function.

This commit fixes the error(s) reported below by valgrind memcheck tool.

Valgrind was used on Ubuntu 14.04 against a Debug build of Slicer. It was
exected doing the following:
 (1) Start a terminal with the appropriate environment: ./Slicer --gnome-terminal
 (2) Start Slicer using valgrind: valgrind --log-file=2015-07-16-Slicer-memcheck.txt --tool=memcheck --leak-check=yes ./bin/SlicerApp-real --disable-python --disable-cli-modules
 (3) Exit Slicer and inspect valgrind log file

Valgrind error:

==17091== Conditional jump or move depends on uninitialised value(s)
==17091==    at 0x2A67C4E7: __printf_fp (printf_fp.c:400)
==17091==    by 0x2A67B792: vfprintf (vfprintf.c:1660)
==17091==    by 0x2A69F578: vsnprintf (vsnprintf.c:119)
==17091==    by 0x2A196E0F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19)
==17091==    by 0x2A19D263: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_float<double>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, char, double) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19)
==17091==    by 0x2A19D54F: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, double) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19)
==17091==    by 0x2A1A8AF4: std::ostream& std::ostream::_M_insert<double>(double) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19)
==17091==    by 0xDB0E07B: vtkMRMLColorNode::SetNameFromColor(int) (vtkMRMLColorNode.cxx:312)
==17091==    by 0xDB0DEBD: vtkMRMLColorNode::SetNamesFromColors() (vtkMRMLColorNode.cxx:295)
==17091==    by 0xDB1CF37: vtkMRMLColorTableNode::SetColor(int, char const*, double, double, double, double) (vtkMRMLColorTableNode.cxx:1301)
==17091==    by 0xDB1F84D: vtkMRMLColorTableStorageNode::ReadDataInternal(vtkMRMLNode*) (vtkMRMLColorTableStorageNode.cxx:146)
==17091==    by 0xDCDE6D5: vtkMRMLStorageNode::ReadData(vtkMRMLNode*, bool) (vtkMRMLStorageNode.cxx:1067)
==17091==  Uninitialised value was created by a heap allocation
==17091==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==17091==    by 0x299257A3: vtkDataArrayTemplate<unsigned char>::Allocate(long long, long long) (vtkDataArrayTemplate.txx:137)
==17091==    by 0x29928227: vtkDataArrayTemplate<unsigned char>::SetNumberOfValues(long long) (vtkDataArrayTemplate.txx:921)
==17091==    by 0x29925A27: vtkDataArrayTemplate<unsigned char>::SetNumberOfTuples(long long) (vtkDataArrayTemplate.txx:355)
==17091==    by 0x2986995A: vtkLookupTable::SetNumberOfTableValues(long long) (vtkLookupTable.cxx:1045)
==17091==    by 0xDB1C6B5: vtkMRMLColorTableNode::SetNumberOfColors(int) (vtkMRMLColorTableNode.cxx:1241)
==17091==    by 0xDB1F783: vtkMRMLColorTableStorageNode::ReadDataInternal(vtkMRMLNode*) (vtkMRMLColorTableStorageNode.cxx:137)
==17091==    by 0xDCDE6D5: vtkMRMLStorageNode::ReadData(vtkMRMLNode*, bool) (vtkMRMLStorageNode.cxx:1067)
==17091==    by 0xC9CD058: vtkMRMLColorLogic::CreateFileNode(char const*) (vtkMRMLColorLogic.cxx:730)
==17091==    by 0xC9CC104: vtkMRMLColorLogic::CreateFreeSurferFileNode(char const*) (vtkMRMLColorLogic.cxx:593)
==17091==    by 0xC9CE463: vtkMRMLColorLogic::AddFreeSurferFileNode(vtkMRMLFreeSurferProceduralColorNode*) (vtkMRMLColorLogic.cxx:863)
==17091==    by 0xC9CF282: vtkMRMLColorLogic::AddFreeSurferNodes() (vtkMRMLColorLogic.cxx:987)

Revision 24435  Directory Listing
Modified Fri Jul 17 05:00:38 2015 UTC (2 years, 2 months ago) by jcfr
STYLE: Improve output of vtkMRMLColorLogicTest1 displaying line number

Revision 24434  Directory Listing
Modified Thu Jul 16 17:29:45 2015 UTC (2 years, 2 months ago) by lassoan
ENH: Allow qMRMLNodeComboBox base name setting for each node type

Revision 24425  Directory Listing
Modified Wed Jul 15 18:58:32 2015 UTC (2 years, 2 months ago) by pinter
ENH: Added removeAttribute function to MRML node comboboxes and proxy model

Attribute filtering in MRML node comboboxes work with only one attribute at a time. So filtering could be "disabled" for volumes by simply overwriting it with the labelmap attribute. As it does not exist any more, it was needed to add the corresponding removeAttribute function to qMRMLNodeComboBox and qMRMLSortFilterProxyModel (it was already implemented in qMRMLNodeFactory)

Revision 24414  Directory Listing
Modified Wed Jul 15 06:02:27 2015 UTC (2 years, 2 months ago) by jcfr
ENH: Added node printself output to node inspector

Detailed node content (output of node->PrintSelf) is now available in
the node inspector.

If the node is changed then the window is updated automatically (if
the node inspector is not visible then no update happens to avoid any
potential performance regressions).

The vtkObject's irrelevant list of observers are removed from the output.

Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Andras Lasso <lasso@queensu.ca>

Revision 24409  Directory Listing
Modified Wed Jul 15 04:10:47 2015 UTC (2 years, 2 months ago) by lassoan
BUG: Fixed node selector node type specification syntax

There was a common syntax error in defining single-element Qt string lists in Python.

The correct way of defining a single element list:
self.outputSelector.nodeTypes = ["vtkMRMLScalarVolumeNode"]

The correct way of defining a single element tuple:
self.outputSelector.nodeTypes = "vtkMRMLScalarVolumeNode",

Currently many modules try to define a single-element tuple like this:
self.outputSelector.nodeTypes = ( ("vtkMRMLScalarVolumeNode"), "" ) => this is long and ugly and also incorrect, as the tuple has actually two elements, "vtkMRMLScalarVolumeNode" and an empty element; the empty element generates the dysfunctional "Create new node" and "Create new node as..." options.

The syntax error is fixed in all modules and a check was added to ignore empty elements in the node type list (in case the syntax error occurs again in the future).

Revision 24402  Directory Listing
Modified Tue Jul 7 19:39:24 2015 UTC (2 years, 2 months ago) by naucoin
BUG: fix regression introduced by adding storage nodes to scene views

Update the test to check for the correct number of nodes, 3 to include
the added storage node in the scene view.

Issue #3956


Revision 24401  Directory Listing
Modified Tue Jul 7 19:30:53 2015 UTC (2 years, 2 months ago) by naucoin
BUG: update test to fix regression

Update the scene view node store test to take into
account the newly added storage nodes in scene view scenes.

Issue #3956


Revision 24399  Directory Listing
Modified Tue Jul 7 17:55:01 2015 UTC (2 years, 2 months ago) by naucoin
BUG: remove storable added after scene view message

Testing showed that this was confusing, remove the observation
on node added events from the capture toolbar as well as the
pop up message. Leaves the popup timeout flag for future messages.
TODO: move the test to on scene view about to be restored.

Issue #3956

Revision 24398  Directory Listing
Modified Tue Jul 7 17:54:52 2015 UTC (2 years, 2 months ago) by naucoin
STYLE: add blank lines to warning message

Make the message more readable by adding white space.

Issue #3956

Revision 24397  Directory Listing
Modified Tue Jul 7 17:54:49 2015 UTC (2 years, 2 months ago) by naucoin
BUG: only time out extra storable message during testing

The pop up window that gives the user feedback about how
not to lose new storable data after creating a scene view
was timing out before some testers could finish reading
and understanding the information. Added a boolean property
to the capture tool bar, popupsTimeOut, that the main
window can set to true when the enable testing attribute
has been turned on. Verified that the test
AddStorableDataAfterSceneViewTest
still passes and doesn't hang.

Issue #3956

Revision 24395  Directory Listing
Modified Tue Jul 7 17:54:42 2015 UTC (2 years, 2 months ago) by naucoin
BUG: update file list members, scene vars, update test

Update the MRB save/restore test to use the slicer util delayDisplay method,
as well as not counting file paths that point to the deleted bundle
expansion directory.
In scene view nodes make sure to also reset the file list
Restore the url and root direcotry after saving a scene to the data bundle
directory so that absolute paths can be calculatediproperly

Issue #3956

Revision 24394  Directory Listing
Modified Tue Jul 7 17:54:36 2015 UTC (2 years, 2 months ago) by naucoin
BUG: Add a test that checks file paths after MRML and MRB save/load

Add a test that checks the paths in the scene with saving to mrml (have to force
a write of a sample data node since the saveScene call only writes out the MRML file,
no storage nodes are triggered to write) and MRB and reloading and saving to MRB.
Remove skipping the master scene view as paths of storage nodes there do need to be updated.
TBD: fix the paths after saving the MRB a second time (they get reset to the deleted bundle directory from the first MRB save).

Issue #3956

Revision 24393  Directory Listing
Modified Tue Jul 7 17:54:31 2015 UTC (2 years, 2 months ago) by naucoin
BUG: remove node SceneRootDir, use RootDirectory on MRML scene

The node ivar scene root directory wasn't staying updated when the root directory was changing on the scene. Updated the code to refer to the scene for the root directory.
One important change is that in the XML parser, the scene has to be set on a storage node before reading/writing it so that the absolute path can be determined.
 Also set the scene root dir more consistently
Updated the fiber bundle node test to use the testing macros since it was reproducing code.

Issue #3956

Revision 24390  Directory Listing
Modified Tue Jul 7 17:54:03 2015 UTC (2 years, 2 months ago) by naucoin
ENH: stress test saving and restoring MRBs, util methods added

Add a test to save and restore MRBs in a loop, fixing the bug note in the
save restore test as well.
Clean up the testing of saving and loading MRBs by exposing the core io
manager loadScene method to Python, and adding a saveScene one. This will
simplify testing since it uses detects that it needs to use the scene writer
which will use the application logic save to MRB bundle directory + zip calls,
so from python you won't need to make the two calls with attendant managing of
temporary directories. Added a note to the application logic header file
pointing to saveScene for general use.

Issue #3956

Revision 24389  Directory Listing
Modified Tue Jul 7 17:53:56 2015 UTC (2 years, 2 months ago) by naucoin
BUG: reduce message noise

When adding a storable node to the scene after a scene view has
been added, make sure that only nodes that are saved with the
scene generate the warning.
Cleaned up debugging messages by changing warning to debug macros.

Issue #3956

Revision 24385  Directory Listing
Modified Tue Jul 7 17:53:41 2015 UTC (2 years, 2 months ago) by naucoin
ENH: factor out adding data io to the scene

Encapsulated setting up the remote IO logic and the data manager IO
in the application so that it can work as an example template.
Moved the hooking up of the data logic to the scene to the application
logic so that it can be called by classes with access to the
application logic, and use it in the volumes logic for the mini
scene.
Added some comments to direct developers to the places they need
to look to hook up a mini scene that can do data management both
locally and remotely.

Issue #3956

Revision 24382  Directory Listing
Modified Tue Jul 7 17:53:24 2015 UTC (2 years, 2 months ago) by naucoin
BUG: warn the user when they add storable data after scene views

When a storable node is added to the scene after scene views,
warn the user that restoring a scene view will lose the newly
added data.

To avoid too many pop ups, don't warn during batch processing.

Issue #3956

Revision 24379  Directory Listing
Modified Tue Jul 7 17:53:11 2015 UTC (2 years, 2 months ago) by naucoin
BUG: use smart pointers for new storage nodes

From JC, use smart pointers for new storable node
storage nodes being added to scene views.

Issue #3956

Revision 24378  Directory Listing
Modified Tue Jul 7 17:53:07 2015 UTC (2 years, 2 months ago) by naucoin
BUG: use smart pointers for leaking storage node

Thanks to JC for pointing out a better way to manage the
new scene view storage node, this change switches to
using a smart pointer.

Issue #3956

Revision 24377  Directory Listing
Modified Tue Jul 7 17:53:04 2015 UTC (2 years, 2 months ago) by naucoin
BUG: add missing storage nodes on scene view save

This is an optional fix, the issue is fixed without it but it
is something that I ran across while digging into the series
of bugs that needed fixing. If you open up Slicer, add a fiducial
and a downloaded sample data volume, then save a scene view, the scene view
is missing storage nodes for those nodes since they haven't been saved yet.
Then when you save the scene to disk, storage nodes are created
(usually by the save data dialog) and added to the main scene.
Now there's a mismatch between the nodes in the main scene, the scene
view saved at the save to disk moment, and the old scene view.

This change checks for storable nodes that are to go into a scene view and
adds storage nodes for them to avoid that node mismatch.

The reason it's optional is that on scene load, the storage nodes are not
triggered to read (and they currently all point to the same file name anyway).
The MRB-Scene View multiple saves and restores test passes without this, but it
makes the mrml file more clean to have matching storage nodes in all scene views.

Issue #3956

Revision 24374  Directory Listing
Modified Tue Jul 7 17:52:54 2015 UTC (2 years, 2 months ago) by naucoin
BUG: fix scene view storage leak on MRB save

The new scene view storage node that was created to
save a scene view snapshot for a new MRB wasn't being
removed from the scene due to a variable scoping issue.
Renamed the variable and stopped it from being hidden and
remove it from the scene and delete as necessary.

Issue #3956

Revision 24373  Directory Listing
Modified Tue Jul 7 17:52:51 2015 UTC (2 years, 2 months ago) by naucoin
BUG: update file list members when saving MRBs

The file lists were not getting updated when volumes with
multiple files listed were saved in the default format of nrrd.
This change saves and restores the file list around MRB saving.
Fixed the unique file name to not just append .nrrd to the end
of the current file name.
TODO: deal with the file lists in the storage nodes in the
master scene view (problem when save a scene as mrml then
save it to mrb).

Issue #3956

Revision 24372  Directory Listing
Modified Tue Jul 7 17:52:48 2015 UTC (2 years, 2 months ago) by naucoin
BUG: check for compressed file names

Get the complete extension when files have paths that end in X.gz.
This fixes bugs that came from multiple saves where a file might
end up with the name brain.nii.nii.nii.nii.gz.

Issue #3956

Revision 24356  Directory Listing
Modified Wed Jun 24 13:27:21 2015 UTC (2 years, 3 months ago) by naucoin
ENH: add utility method to display node in only 1 view

Since the view node id logic is set up to be backward compatible (no view node
id set means showing in all views), provide a convenience function,
SetDisplayableOnlyInView, that reduces this operation to one call.
It places the calls to remove all view node ids and add the new one inside of
a disable modified events block to avoid flicker.
Added testing.

Issue #3196


Revision 24350  Directory Listing
Modified Fri Jun 19 22:06:25 2015 UTC (2 years, 3 months ago) by jcfr
ENH: Multiple node types can be created in qMRMLNodeComboBox

Now any of the supported node types can be created in a qMRMLNodeComboBox
- as it was available in Slicer3 and requested for Slicer4.

Note also that the combo box special entry "Create and Rename new <node>"
has been changed into "Create new <node> as...".

Fixes http://www.na-mic.org/Bug/view.php?id=3748

Reviewed-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Andras Lasso <lasso@queensu.ca>

Revision 24346  Directory Listing
Modified Fri Jun 19 18:53:25 2015 UTC (2 years, 3 months ago) by jcfr
STYLE: Update volume info widget to track volume node using a weak pointer

Use a weak pointer to make sure no dangling pointers are accidentally used.

Revision 24344  Directory Listing
Modified Fri Jun 19 15:31:45 2015 UTC (2 years, 3 months ago) by alexy
BUG: 3857. Fixed parallel/perpendicular diffusivity on glyphs, interactive seeding line display.

Revision 24341  Directory Listing
Modified Thu Jun 18 02:52:07 2015 UTC (2 years, 3 months ago) by lassoan
STYLE: Removed remnants of non-existent qMRMLNodeSelector class

Revision 24340  Directory Listing
Modified Thu Jun 18 02:46:29 2015 UTC (2 years, 3 months ago) by lassoan
ENH: Added warning if obsolete LabelMap flag used in node selector

If the obsolete LabelMap attribute is used in qMRMLNodeComboBox then the attribute is ignored and a warning is logged.
This way modules that are not yet updated to use vtkMRMLLabelMapVolumeNode will still work reasonably well.

Revision 24338  Directory Listing
Modified Wed Jun 17 16:05:11 2015 UTC (2 years, 3 months ago) by jcfr
ENH: Backwards compatible FixedParameters

This patch provides alternatives for both
defining the m_FixedParameters of a transfor
as either the old-style ParametersType or
preferably the new-style FixedParametersType
when it is available in ITK.

Prepare for post ITK4.8 TransformFix

This patch makes Slicer prepared for future changes to
ITK that can not be backwards compatible.

http://review.source.kitware.com/#/c/19921/

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 24312  Directory Listing
Modified Wed Jun 17 15:44:02 2015 UTC (2 years, 3 months ago) by jcfr
ENH: Expose qMRMLNodeComboBox::addMenuAction to python

Revision 24311  Directory Listing
Modified Wed Jun 17 15:44:00 2015 UTC (2 years, 3 months ago) by jcfr
ENH: MRMLNodeComboBox - Support custom behavior for default action

If a given default action (Add, Remove, Edit or Rename) is disabled, it
is now possible to add a custom action with a similar name. This will
allow to implement customize behavior.

Revision 24305  Directory Listing
Modified Thu Jun 11 02:04:23 2015 UTC (2 years, 3 months ago) by lassoan
BUG: Fixed crash on scene close due to missing null-pointer check

Revision 24304  Directory Listing
Modified Tue Jun 9 14:45:22 2015 UTC (2 years, 3 months ago) by lassoan
BUG: Fixed FOV reset during volume selection propagation

FOV of all slice views were reset during volume selection propagation. Even for views where volume selection propagation was disabled.

Fixes (at least partially) http://www.na-mic.org/Bug/view.php?id=4000

Revision 24297  Directory Listing
Modified Thu Jun 4 22:30:59 2015 UTC (2 years, 3 months ago) by jcfr
STYLE: Fix unused variable warning in vtkMRMLSliceLayerLogic

Revision 24293  Directory Listing
Modified Thu Jun 4 21:28:22 2015 UTC (2 years, 3 months ago) by pinter
ENH: Added labelmap node support to subject hierarchy

Subject hierarchy knew about the single vtkMRMLScalarVolumeNode class, but now that the vtkMRMLLabelMapVolumeNode has been introduced, a separate subject hierarchy plugin was created for labelmaps. This way it is cleaner that one role plugin assigns one icon and the same set of functionality to its owned nodes.

Fixed issue in sitkUtils: it created a scalar volume node regardless whether a labelmap was already created

Removed temporary contour references from model slice displayable manager (segmentations has its own displayable manager)

Added concept of virtual subject hierarchy branches, which is a branch for which its parent is solely reaponsible, i.e. the child nodes do not correspond to actual MRML nodes, but to items contained in the parent node to enable per-item handling from subject hierarchy (e.g. segments in segmentations and fiducials in markups)

Create and expose cloneSubjectHierarchyNode method in qSlicerSubjectHierarchyCloneNodePlugin to enable easy cloning of any node (clone SH node, data node, display and storage nodes)

Revision 24292  Directory Listing
Modified Thu Jun 4 21:10:56 2015 UTC (2 years, 3 months ago) by pinter
STYLE: Indentation fixes

Revision 24291  Directory Listing
Modified Thu Jun 4 20:12:02 2015 UTC (2 years, 3 months ago) by lassoan
ENH: Use vtkMRMLLabelMapVolumeNode class for labelmap volumes

Before vtkMRMLScalarVolumeNode was used for both scalar and label map
volumes and the LabelMap custom MRML node attribute was used for
distinguishing between them (0=scalar; 1=label map volume).
This made conversion between labelmap/scalar volumes very easy but made
it difficult to customize behavior, display, processing of segmentation
information.

Now a new vtkMRMLLabelMapVolumeNode class is used for storing segmentation
information (still using vtkMRMLScalarVolume used as base class for backward
compatibility; but in the future the base class may be changed to reflect
that segmentation can be represented in various ways, not just as volumes).

Notes:

A new "segmentation" node has been developed that is based on vtkMRMLLabelMapVolumeNode,
which can store segmentation information in various ways (not just labelmaps but planar
contours, closed surfaces, etc). To allow using of this new segmentation node,
first the vtkMRMLLabelMapVolumeNode has to be integrated into the Slicer core.

When reading a scene that was saved with an old version of Slicer, label maps are stored
in vtkMRMLScalarVolumeNode with label map attribute set to 1. Added a check for this case
and handle it by converting the vtkMRMLScalarVolumeNode to a vtkMRMLLabelMapVolumeNode during import.

Revision 24281  Directory Listing
Modified Fri May 29 13:50:33 2015 UTC (2 years, 3 months ago) by lassoan
BUG: Fixed qMRMLVolumeWidget crash on scene close

Weak pointers should be used in all widgets for referencing MRML nodes because MRML nodes may be deleted without notifying widgets when closing the scene.

Revision 24273  Directory Listing
Modified Tue May 26 15:23:27 2015 UTC (2 years, 4 months ago) by alexy
BUG: 3857. Added support for Parallel and Perpendicular Diffusivity.

Revision 24260  Directory Listing
Modified Fri May 15 19:54:58 2015 UTC (2 years, 4 months ago) by pieper
BUG: #2267 fix symmetry of label outline thickness

There was a miscalculation of the array indices that caused
the lines to be wider and thicker on the left and top of a
label region.

From: Steve Pieper <pieper@isomics.com>

Revision 24257  Directory Listing
Modified Thu May 14 22:46:36 2015 UTC (2 years, 4 months ago) by pieper
BUG: #2267 - remove mask code from vtkImageLabelOutline

Since vtkImageLabelOutline inherits from vtkImageNeighborhoodFilter
it has a fixed size mask for defining 4-connect vs 8-connect
kernels.  When we tried to use bigger kernels this caused overstepping
outside the mask which can lead to an access violation.

From: Steve Pieper <pieper@bwh.harvard.edu>

Revision 24256  Directory Listing
Modified Thu May 14 22:26:08 2015 UTC (2 years, 4 months ago) by pieper
BUG: #2267 image label outline incorrect

There was a logic error in the outline kernel calculation
from a previous commit.

https://github.com/Slicer/Slicer/commit/cd654faa89279694af12f5d7bbaa053281594881

From: Steve Pieper <pieper@bwh.harvard.edu>

Revision 24245  Directory Listing
Modified Tue May 12 23:05:59 2015 UTC (2 years, 4 months ago) by lassoan
BUG: Fixed transform setting failure

When trying to set a transform that is shown in the Transforms module GUI and the new value has a component that is outside the current slider min/max range then the min/max range is updated but the transform value is not updated. The problem is that the unit module resets the value of a transform even if only the min/max range is set (it supposed to only do that if the precision is changed).

Added a check to prevent resetting of the transform value if precision is not changed.

Revision 24244  Directory Listing
Modified Tue May 12 23:01:27 2015 UTC (2 years, 4 months ago) by lassoan
BUG: Fixed crash when currently shown linear transform is set

Crash happened when currently shown linear transform was set to a value that has a component that is higher than current threshold.

How to reproduce:
* Go to Transforms module
* Create a linear transform
* Set a translation component to 500 => crash!

t=slicer.util.getNode('LinearTransform_3')
m=vtk.vtkMatrix4x4()
m.SetElement(0,3,500)
t.SetMatrixTransformToParent(m)

Revision 24241  Directory Listing
Modified Tue May 12 06:04:19 2015 UTC (2 years, 4 months ago) by jcfr
BUG: Do not reset slice node "layout color" and "layout label". Fixes #1770

Since layout color and layout label are both associated with layout name,
this commit ensures their values is not reset so that slice widgets are
properly updated after closing the scene.

This will ensure that:

* ViewControllers widgets are not displayed in gray (default slice view
color) if the scene is closed before opening the module.

* LayoutLabel for Slice, ThreeD views is not cleared after closing the
scene.

Revision 24240  Directory Listing
Modified Tue May 12 03:37:03 2015 UTC (2 years, 4 months ago) by jcfr
BUG: Resolve multithread issue that caused errors with multiple b values.

Fixes #3977

See http://www.na-mic.org/Bug/view.php?id=3977

From: Lauren J. O'Donnell <odonnell@bwh.harvard.edu>

Revision 24222  Directory Listing
Modified Fri May 8 02:49:05 2015 UTC (2 years, 4 months ago) by jcfr
BUG: Fix RSNA2012ProstateDemo (attempt #2)

This commit completes the fix introduced in previous commit allowing
the test to finish when using the provided scene and doing 5 iterations of
scene view restore. In previous commit, a trimmed down scene file has
been used.

Revision 24221  Directory Listing
Modified Thu May 7 19:01:25 2015 UTC (2 years, 4 months ago) by jcfr
BUG: Fix RSNA2012ProstateDemoTest

This commit ensures vtkMRMLSliceLayerLogic::UpdateNodeReferences() can
be called when setting a null scene.

It fixes a regression introduced in r24216 (BUG: Fix
qMRMLLayoutManagerTest2 - Setting new scene reset view node factories)
where the scene of the "view widget to delete" is set to 0.

Revision 24220  Directory Listing
Modified Thu May 7 19:01:23 2015 UTC (2 years, 4 months ago) by jcfr
STYLE: Add TEST_GET_OBJECT_* macros to vtkMRMLCoreTestingMacros.h file

Revision 24219  Directory Listing
Modified Thu May 7 19:01:21 2015 UTC (2 years, 4 months ago) by jcfr
STYLE: Remove redundant and unused vtkMRMLSliceLogicTest.cxx file

Revision 24218  Directory Listing
Modified Thu May 7 05:13:58 2015 UTC (2 years, 4 months ago) by jcfr
BUG: Fix crash in qMRMLMatrixWidget::setMRMLTransformNode

Revision 24217  Directory Listing
Modified Wed May 6 19:15:03 2015 UTC (2 years, 4 months ago) by jcfr
STYLE: Explicitly identify layout node arrangements

This commit (1) adds a comment clearly identifying deprecated layout
arrangement and (2) update qMRMLLayoutManagerTest4 to also use the
convenience test function "checkViewArrangement()"

Revision 24216  Directory Listing
Modified Wed May 6 19:15:01 2015 UTC (2 years, 4 months ago) by jcfr
BUG: Fix qMRMLLayoutManagerTest2 - Setting new scene reset view node factories

Revision 24215  Directory Listing
Modified Tue May 5 22:15:28 2015 UTC (2 years, 4 months ago) by jcfr
BUG: Fix "orphan view" issue in layout manager

The widget visibility is now set considering both the MappedInLayout
and the Visibility view node properties.

It fixes a regression re-introduced in r24209 (ENH: Update layout
view factory to consider view node visibility property) that was
originally fixed in r24175 (BUG: Fixed orphaned views displayed in
secondary layout widgets).

This commit also extends vtkMRMLAbstractViewNode API adding:
* IsMappedInLayout() / SetMappedInLayout()
* IsViewVisibleInLayout()

Test "qMRMLLayoutManagerVisibilityTest" has also been updated to check
the value returned by "IsMappedInLayout()", "IsViewVisibleInLayout()"
and "GetVisibility()".

Note also that functions "IsMappedInLayout()" and "SetMappedInLayout()"
still set/get the "MappedInLayout" attribute. This was done to ensure
existing code relying on its value would still work.

Revision 24212  Directory Listing
Modified Sun May 3 00:38:11 2015 UTC (2 years, 4 months ago) by jcfr
BUG: Fix vtkMRMLCameraDisplayableManagerTest1

This commit updates the baseline to acount for changes introduced
in r24208  (BUG: Change default value for vtkMRMLAbstractViewNode
Visibility property)

Revision 24211  Directory Listing
Modified Sat May 2 07:35:22 2015 UTC (2 years, 4 months ago) by jcfr
STYLE: Improve vtkMRMLNode apidox

* Use \brief to ensure function description is included in listing.
* Use \note and \warning

Revision 24210  Directory Listing
Modified Sat May 2 07:35:20 2015 UTC (2 years, 4 months ago) by jcfr
STYLE: Improve vtkMRMLScene apidox

* Use \brief to ensure function description is included in listing.
* Fix typo
* Use \link to reference enum value declared in vtkMRMLScene

Revision 24209  Directory Listing
Modified Sat May 2 03:34:19 2015 UTC (2 years, 4 months ago) by jcfr
ENH: Update layout view factory to consider view node visibility property

Calling SetVisibility on any view node mapped into a layout will show or
hide the associated widget.

This commit also introduces a new test named "qMRMLLayoutManagerVisibilityTest"

Revision 24208  Directory Listing
Modified Sat May 2 03:34:16 2015 UTC (2 years, 4 months ago) by jcfr
BUG: Change default value for vtkMRMLAbstractViewNode Visibility property

This commit fixes a regression introduced in r21034 (STYLE: Add abstract
class for all view nodes) where default value of the visibility
property (originally associated with vtkMRMLViewNode) has been changed
from 1 to 0.

This commit set the default value to 1.

Revision 24204  Directory Listing
Modified Fri May 1 00:32:20 2015 UTC (2 years, 4 months ago) by lassoan
ENH: Improved vtkMRMLTransformNode::ApplyTransform

Fixed crash when a transform is applied to an empty transform node (it just sets the applied transform in the node).
Improved documentation.

Revision 24203  Directory Listing
Modified Thu Apr 30 20:50:50 2015 UTC (2 years, 4 months ago) by naucoin
BUG: add outline thickness for label map outlines

Use the Outline setting on the image label outline filter to increase the
outline thickness.
The label outline value is used as the kernel size radius.
Added a GUI for the label outline integer, copied from the Models display GUI,
still using SliceIntersectionThickness as that's the display node setting that's
used by the filter.
Set the default slice intersection thickenss to 3 for label map volume
display nodes.

Issue #2267

Revision 24201  Directory Listing
Modified Thu Apr 30 07:10:03 2015 UTC (2 years, 4 months ago) by jcfr
ENH: Extend vtkMRMLScene::GetFirstNode API adding exactNameMatch parameter

If set to False, the name matching will be done considering the byName
parameter as a regular expression.

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24200  Directory Listing
Modified Thu Apr 30 07:10:00 2015 UTC (2 years, 4 months ago) by jcfr
STYLE: Add test for vtkMRMLScene::GetFirstNode

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24198  Directory Listing
Modified Wed Apr 29 23:27:51 2015 UTC (2 years, 4 months ago) by jcfr
BUG: Ensure qMRMLLayoutManager::viewWidget can return custom widget

This commit updates the function so that it can return widget created
either (a) by layout factory associated with a new type of node or
(b) by specialized layout factory associated with an existing node type.

Revision 24188  Directory Listing
Modified Wed Apr 22 15:31:48 2015 UTC (2 years, 5 months ago) by jcfr
STYLE: Fix doxygen in qMRMLChartView

Revision 24183  Directory Listing
Modified Tue Apr 21 02:40:23 2015 UTC (2 years, 5 months ago) by lassoan
ENH: Removed unnecessary UpdateExtent hack from vtkMRMLSliceLayerLogic

Not needed since using the vtkImageReslice filter in VTK, which properly manager the update extent.

Revision 24182  Directory Listing
Modified Tue Apr 21 02:34:20 2015 UTC (2 years, 5 months ago) by lassoan
ENH: Improve reslicing speed of quasi-axis-aligned slices

Reslicing speed is 10-20% faster if reslice transform is a permute transform (only reordering of axis and scaling).
Reslice filter checks for strict zero equality to detect a permute transform, which often misses permute transforms
which have very very small values but not exactly zeros.

Added a method to suppress very small components in a transformation matrix (relative to the largest component)
before passing to reslice filter to allow more volumes benefit from this speed optimization.

Revision 24175  Directory Listing
Modified Fri Apr 17 17:14:11 2015 UTC (2 years, 5 months ago) by lassoan
BUG: Fixed orphaned views displayed in secondary layout widgets

Revision 24171  Directory Listing
Modified Mon Apr 13 15:07:16 2015 UTC (2 years, 5 months ago) by jcfr
STYLE: Simplify code in vtkMRMLVolumeArchetypeStorageNode

From: Andras Lasso <lasso@queensu.ca>

Revision 24170  Directory Listing
Modified Mon Apr 13 15:07:15 2015 UTC (2 years, 5 months ago) by jcfr
STYLE: Fix comment in vtkMRMLLabelMapVolumeDisplayNode

From: Csaba Pinter <csaba.pinter@queensu.ca>

Revision 24133  Directory Listing
Modified Tue Mar 31 20:13:22 2015 UTC (2 years, 5 months ago) by jcfr
STYLE: itkMGHImageIO - Remove usage of reserved "__" prefix in header guard

This commit address clang warning "-Wreserved-id-macro"

Suggested-by: Bradley Lowekamp <blowekamp@mail.nih.gov>

Revision 24131  Directory Listing
Modified Tue Mar 31 03:05:01 2015 UTC (2 years, 5 months ago) by jcfr
STYLE: Refactor qMRMLLayoutManager introducing "setLayoutManager()"

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Andras Lasso <lasso@queensu.ca>

Revision 24128  Directory Listing
Modified Fri Mar 27 22:05:21 2015 UTC (2 years, 6 months ago) by jcfr
ENH: Generalize Editor "propagationMode" to support arbitrary set of layers

This commit makes the Layer enum introduced in the r24106 public and uses
the Layer enum value to set the editor "propagationMode" value.

Reviewed-by: Andriy Fedorov <fedorov@bwh.harvard.edu>
Reviewed-by: Alireza Mehrtash <mehrtash@bwh.harvard.edu>
Reviewed-by: Steve Pieper <pieper@bwh.harvard.edu>

Revision 24126  Directory Listing
Modified Fri Mar 27 21:00:17 2015 UTC (2 years, 6 months ago) by lassoan
ENH: Enabled output VTK error and warning testing for all qMRMLWidgetCxxTests

Now any qMRMLWidgetCxxTests test fails if VTK error or warning is logged during execution.

Several test errors are fixed (mainly due to missing or changed nodes) and where error/warning is expected exceptions added.

Revision 24124  Directory Listing
Modified Fri Mar 27 17:53:28 2015 UTC (2 years, 6 months ago) by alexy
ENH: reverted the order of adding scalars and normals so the scalars added first. Some modules take the first component.

Revision 24122  Directory Listing
Modified Fri Mar 27 14:33:02 2015 UTC (2 years, 6 months ago) by jcfr
COMP: Fix "unused-but-set-variable" warning in vtkMRMLNode

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 24121  Directory Listing
Modified Fri Mar 27 14:32:59 2015 UTC (2 years, 6 months ago) by jcfr
ENH: Added support in vtkMRMLNode for multiple references to the same node

Fixed limitations of node references:

* Node reference modification request (SetAndObserveNthNodeReferenceID)
  was ignored if only events were different. This caused an issue in
  OpenIGTLinkIF, because different nodes in the same role required
  different event observations and so the role-default events that were
  restored from the scene were not correct.

* One node could only be referenced a single time only, otherwise the
  most recently added/removed/modified reference overwrote all the
  previous event observations. This limitation was not acceptable,
  because even a temporarily created reference (the user selects a node
  as input that is already selected as an input in another node selector)
  could remove event observations. This caused an issue in Fiducial
  registration wizard, which has two input fiducial lists, and when the
  user selected one input fiducial list it often removed the observer
  from the other input fiducial list.

Other related changes:

* Simplified node references implementation: all reference
  add/remove/modification operations go through a single method
  (SetAndObserveNthNodeReferenceID), previously there were many potential
  execution path for these operations, which made it difficult to make
  changes consistently.

* Fixed ObserverManager to update the observation even if only events or
  priorities are changed.

* Made vtkMRMLNodeReference data members ReferencingNode, ReferencedNode,
  Events accessible only by get/set functions to allow consistency checks.

* Renamed vtkMRMLNode::RemoveAllNodeReferenceIDs to RemoveNodeReferenceIDs
  to be consistent with similar method names

From: Andras Lasso <lasso@queensu.ca>

Revision 24116  Directory Listing
Modified Thu Mar 26 20:17:28 2015 UTC (2 years, 6 months ago) by lassoan
BUG: Added back ITK image IO factory registration to qMRMLSliceWidgetTest2

It is required for successful loading of volume from nrrd file.

Revision 24114  Directory Listing
Modified Thu Mar 26 15:30:57 2015 UTC (2 years, 6 months ago) by lassoan
BUG: Fixed more silsntly failing tests

qMRMLSliceWidgetTest2
qMRMLVolumeThresholdWidgetTest2

Revision 24113  Directory Listing
Modified Thu Mar 26 14:39:42 2015 UTC (2 years, 6 months ago) by lassoan
BUG: Log warnings instead of throw exception from vtkITKArchetypeImageSeriesReader

If an exception is thrown in the middle of a pipeline update then the state of the pipeline becomes inconsistent,
therefore all exceptions should be caught, logged as error, and return with an error status.

Removed commented out macros that log message instead of throwing exception, because there is no automatic way
for converting error handling by exception to error handling by logging&returning with error status.
Exceptions that are thrown in the VTK file are removed and exceptions that are thrown from other classes are caught.

Also changed catch(...) to catch ITK exceptions instead. Catch(...) might be only considered in a high-level application error handler (but even then the application state may be irrecoverable), but it must not be caught ever in library code.

Revision 24112  Directory Listing
Modified Thu Mar 26 04:30:01 2015 UTC (2 years, 6 months ago) by lassoan
BUG: Fixed silently failing qSlicerWidgetTest2

qSlicerWidgetTest2 had two important errors:


1. The test actually failed

It could not load the input image, as reported on the dashboard:

http://slicer.cdash.org/testDetails.php?test=6130889&build=403273

ERROR: In ..\..\..\..\..\Slicer-1\Libs\MRML\Core\vtkMRMLVolumeArchetypeStorageNode.cxx, line 367
vtkMRMLVolumeArchetypeStorageNode (0000000004D4BE20): ReadData: Cannot read file as a volume of type Volume[fullName = C:/D/N/Slicer-1-build/Slicer-build/Base/QTGUI/Testing/Cxx/share/MRML/Testing/TestData/fixed.nrrd]
	Number of files listed in the node = 0.
	File reader says it was able to read 0 files.
	File reader used the archetype file name of C:/D/N/Slicer-1-build/Slicer-build/Base/QTGUI/Testing/Cxx/share/MRML/Testing/TestData/fixed.nrrd []

The problem was that no ITK image IOs were registered.
Fixed by adding ITKFactoryRegistration to the test.
Also added proper logging of ITK exception data in vtkMRMLVolumeArchetypeStorageNode.


2. The test did not report the failure

The test just logged the error but nobody noticed (it was not reported as an error on the dashboard).

Fixed by using VTK output testing by adding these 3 lines of code:

#include <vtkTestingOutputWindow.h>
...
TESTING_OUTPUT_INIT;
...
TESTING_OUTPUT_ASSERT_WARNINGS_ERRORS(0);

Now if there is any warnings or error during the test then it returns with failure.

VTK output testing should be similarly added for more (probably all) tests.

Revision 24111  Directory Listing
Modified Thu Mar 26 04:20:09 2015 UTC (2 years, 6 months ago) by lassoan
ENH: Added VTK output window class for capturing VTK errors/warnings during testing

Currently VTK errors and warnings are ignored in automatic test, while they often
detect real errors. This class helps detecting unexpected errors and warnings.

Example use:

// Initialize output window. All messages are logged to the console.
TESTING_OUTPUT_INIT;

...

// Set up a checkpoint, we restart counting messages from this point
TESTING_OUTPUT_RESET;
...do something that should not log error messages
// Exit with EXIT_FAILURE if any warnings or errors are logged
TESTING_OUTPUT_ASSERT_WARNINGS_ERRORS(0);

TESTING_OUTPUT_RESET;
...do something that should log error messages
TESTING_OUTPUT_ASSERT_ERRORS_MINIMUM(1);

Revision 24106  Directory Listing
Modified Wed Mar 25 07:27:35 2015 UTC (2 years, 6 months ago) by jcfr
ENH: Add option to control the PropagateVolumeSelection behavior

* Options added so volume selection can propagate only to background,
foreground and label layers.

* HelperBox and EditUtil were modified to use the new propagation mode.

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Alireza Mehrtash <mehrtash@bwh.harvard.edu>

Revision 24099  Directory Listing
Modified Tue Mar 24 21:31:42 2015 UTC (2 years, 6 months ago) by alexy
BUG: 3857. Fixed displaying of Tensor properties and their ranges in Tractography display module for lines/tubes/glyphs

Revision 24072  Directory Listing
Modified Mon Mar 16 22:57:09 2015 UTC (2 years, 6 months ago) by jcfr
BUG: Keep NodeIDs cache up-to-date when importing Singleton node

This commit avoids the error message like [1] (displayed by running
'Abdominal_Atlas_2012') from being printed by ensuring
modified event associated with the import of singleton are invoked
after the NodeIDs cache is updated.

[1] GetNodeByID: Node is in the scene, but its ID is missing from the NodeIDs cache: vtkMRMLClipModelsNode1

Revision 24071  Directory Listing
Modified Mon Mar 16 22:57:07 2015 UTC (2 years, 6 months ago) by jcfr
COMP: Ensure vtkMRMLScene can be compiled with MRMLSCENE_VERBOSE set to 1

Revision 24070  Directory Listing
Modified Sun Mar 15 00:51:33 2015 UTC (2 years, 6 months ago) by jcfr
BUG: Support restoring of a sceneview not having a camera

Revision 24069  Directory Listing
Modified Sun Mar 15 00:51:29 2015 UTC (2 years, 6 months ago) by jcfr
STYLE: Remove unused code

Revision 24068  Directory Listing
Modified Sun Mar 15 00:51:27 2015 UTC (2 years, 6 months ago) by jcfr
BUG: Fix py_RSNA2012ProstateDemo test

Ensure all view widgets are created when switching to a sceneview
with a different layout.

Revision 24067  Directory Listing
Modified Sat Mar 14 02:49:03 2015 UTC (2 years, 6 months ago) by jcfr
ENH: Update SetAndObserveObject to display a warning if setting same object

This commit updates "SetAndObserveObject" to display a warning
if setting the same node again. The behavior is now consistent with
the function "SetAndObserveObjectEvents".

The function slicer logics and display node are also
updated to avoid such warning.

Revision 24066  Directory Listing
Modified Sat Mar 14 02:49:01 2015 UTC (2 years, 6 months ago) by jcfr
ENH: Update SetAndObserveObjectEvents to match SetAndObserveObject

Both function now returns if trying to set the same node.

Revision 24065  Directory Listing
Modified Sat Mar 14 02:48:59 2015 UTC (2 years, 6 months ago) by jcfr
BUG: Fix MRML warning "Setting the same object should be a no-op."

This commit fixes warning reported in a lot of test (for example py_RSNA2012ProstateDemo)

Warning: In /home/jcfr/Projects/Slicer/Libs/MRML/Core/vtkObserverManager.cxx, line 131
vtkObserverManager (0x65dcff0): Setting the same object should be a no-op.

Revision 24047  Directory Listing
Modified Tue Mar 10 15:50:52 2015 UTC (2 years, 6 months ago) by jcfr
ENH: Add scene static method to set storable nodes modified since read

Add a convenience function that takes a collection of nodes and
call it from the function that creates the collection of storable
nodes.

Issue #3698

Inspired-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Nicole Aucoin <nicole@bwh.harvard.edu>

Revision 24046  Directory Listing
Modified Tue Mar 10 15:50:50 2015 UTC (2 years, 6 months ago) by jcfr
BUG: Set scene to MRB directory instead of temp

When loading an MRB the MRML scene url was left pointing to
the deleted temporary directory. This change resets the URL
to point to a mrml file in the same location as the MRB so
that on subsequent saves the default location is correct.
Since the temporary directory is deleted after loading,
mark all the storable nodes as modified since read so that
they will be properly flagged in the save data dialog for
writing.
Support relative paths for loading MRBs (the unzip call
needs an absolute path).

Issue #3698

From: Nicole Aucoin <nicole@bwh.harvard.edu>

Revision 24042  Directory Listing
Modified Tue Mar 10 03:40:06 2015 UTC (2 years, 6 months ago) by jcfr
STYLE: Add inclusion to guard to vtkAddon.h

Revision 24041  Directory Listing
Modified Tue Mar 10 03:27:02 2015 UTC (2 years, 6 months ago) by lassoan
COMP: Added missing file to source control

Revision 24039  Directory Listing
Modified Tue Mar 10 02:30:03 2015 UTC (2 years, 6 months ago) by lassoan
ENH: Added vtkInfoMacro

Added in a new vtkAddon library, which contains Slicer's VTK add-ons that eventually could be moved to VTK proper.

Resolves https://github.com/Slicer/Slicer/pull/205

Revision 24038  Directory Listing
Modified Mon Mar 9 17:27:59 2015 UTC (2 years, 6 months ago) by jcfr
STYLE: Remove unused ivar from qMRMLLayoutManagerPrivate

* GridLayout became obsolete following r15995 (ENH: Add
support for layout XML descriptions.)

* SavedCurrentViewArrangement became obsolete following r16046 (ENH: Move
lastvalidlayout from qMRMLLayoutManager to vtkMRMLLayoutLogic)

* TargetWidget became obsolete following r15129 (ENH: Separate MRML
specific code of qSlicerLayoutManager into qMRMLLayoutWidget.)

Revision 24037  Directory Listing
Modified Mon Mar 9 17:27:57 2015 UTC (2 years, 6 months ago) by jcfr
STYLE: Remove unused methods from qMRMLLayoutManagerPrivate

This commit removes code that became obsolete following
r24017 (ENH: Add qMRMLLayoutViewFactory)

Revision 24036  Directory Listing
Modified Mon Mar 9 17:27:56 2015 UTC (2 years, 6 months ago) by jcfr
BUG: Fix qMRMLLayoutManager::viewWidget method

This commit fixes a regression introduced by r24017 (ENH: Add qMRMLLayoutViewFactory)

Revision 24035  Directory Listing
Modified Mon Mar 9 07:23:47 2015 UTC (2 years, 6 months ago) by lassoan
BUG: Fixed crash on application exit

Fixes failing atlas tests on the dashboard.

The problem was that vtkMRMLModelDisplayableManager unregistered vtkMRMLSelection singleton node in the destructor that it did not register before (therefore causing crash due to double-delete later when the true owners of the object unregistered).

Revision 24034  Directory Listing
Modified Mon Mar 9 07:23:21 2015 UTC (2 years, 6 months ago) by lassoan
COMP: Added back Q_ASSERT for catching errors during tests

Use null-pointer check to prevent crash in release mode but added back Q_ASSERT to trigger a test error during test runs.
Fixed typo.

Revision 24033  Directory Listing
Modified Mon Mar 9 03:24:18 2015 UTC (2 years, 6 months ago) by lassoan
ENH: Added null pointer check

With the check Slicer fails gracefully (logs the error and does not update the invalid scene model item) instead of crashing.

Revision 24032  Directory Listing
Modified Mon Mar 9 03:00:01 2015 UTC (2 years, 6 months ago) by lassoan
ENH: Use Start/EndModify instead of manually calling InvokePendingModifiedEvent

Replaced obsolete DisabledModifiedEventOn/Off, InvokePendingModifiedEvent combination by Start/EndModify (it is simpler and works for nested Start/EndModify)

Revision 24031  Directory Listing
Modified Sun Mar 8 17:18:12 2015 UTC (2 years, 6 months ago) by lassoan
BUG: Fixed markup custom modification event notifications

Fixes http://www.na-mic.org/Bug/view.php?id=3961 (markups RemoveAllItems not working properly) and many other update issues.

Problem:
StartModify/EndModify mechanism works well for Modified() event compression. Such mechanism is desirable for custom, more specific modified events, too (such as when markups are added, removed, modified).
For example, the same mechanism was implemented for TransformModified and for MarkupAddedEvent, MarkupRemovedEvent, etc.

Solution:
To reduce code duplication and the chance of making mistakes (e.g., Markup modification event compression was implemented incorrectly), the mechanism is now available for custom modified events.
Usage is very simple instead of calling vtkMRMLNode::InvokeEvent on has to call vtkMRMLNode::InvokeCustomModifiedEvent. InvokeCustomModifiedEvent behaves the same way as InvokeEvent by default,
but if DisableModifiedEvent is enabled then InvokeCustomModifiedEvent only emits the event when EndModify is called (after invoking the pending standard Modified event).

Revision 24030  Directory Listing
Modified Sun Mar 8 05:34:56 2015 UTC (2 years, 6 months ago) by lassoan
BUG: Fixed crash in CropVolumeSelfTest

vtkImageData observer was not removed when vtkMRMLScalarVolumeNode::SetAndObserveImageData(NULL) was called.
This caused crash when Modified() was called on the vtkImageData because the target object of the observation (vtkTrivialProducer) is deleted by this->SetImageDataConnection(0).

Revision 24022  Directory Listing
Modified Thu Mar 5 08:46:13 2015 UTC (2 years, 6 months ago) by jcfr
BUG: Fix qMRMLLayoutManagerTest1

Fix regression introduced by previous commit (ENH: Add qMRMLLayoutViewFactory).

Prior to commit(ENH: Add qMRMLLayoutViewFactory):
   (1) views were not created without a viewport
and
   (2) scene was re-scanned in the function "updateWidgetsFromViewNodes"
to create missing widgets if needed.

This commit restores the previous behavior by:
  (1) avoiding creating a view if there are no viewport
and
  (2) ensuring missing view are created when setting a new viewport

Revision 24021  Directory Listing
Modified Thu Mar 5 08:46:11 2015 UTC (2 years, 6 months ago) by jcfr
BUG: Fix RSNAQuantTutorial test

After downloading and extracting the dataset "dataset3_PETCT.zip"
associated with this test using url [1], it was possible to reproduce
the problem by executing these two lines in the python interpretor:

  slicer.util.loadScene('/path/to/PET_CT_pre-treatment.mrb')
  slicer.mrmlScene.Clear(0)

Considering that (1) the corresponding scene has four vtkMRMLViewNode nodes
and (2) the conventional layout is include only one vtkMRMLViewNode node,
there was a discrepancy between the method "viewCount()" and "viewWidget(int id)".

More specifically, the "viewCount()" method was returning the number of
entries in the Views ivar of the qMRMLLayoutViewFactory whereas the method
"viewWidget(int id)" was looking up the widget from within the registered
views associated with the ctkLayoutViewFactory.

It means that when "PET_CT_pre-treatment.mrb", was loaded and the scene
cleared, the method XXXX was failing to retrieve the view widget because
only one view was in the list of "registeredViews".

[1] http://slicer.kitware.com/midas3/download?items=124185

Revision 24020  Directory Listing
Modified Thu Mar 5 08:46:09 2015 UTC (2 years, 6 months ago) by jcfr
BUG: Fix MRML layout logic to maintain backward compatibility

This commit fixes regression introduced by previous
commit (ENH: Add qMRMLLayoutViewFactory) and ensured that threeD, Slice
and Chart node will be named as expected.

Before this commit:

  Chart -> ViewChartView1, ViewChartView1, ...
  ThreeD -> View1, View2, ...
  Slice -> ViewSliceGreen, ViewSliceYello, ...

After this commit:

  Chart -> ChartView1, ChartView1, ...
  ThreeD -> View1, View2, ...
  Slice -> SliceGreen, SliceRed, ...

Co-authored-by: Johan Andruejol <johan.andruejol@kitware.com>

Revision 24019  Directory Listing
Modified Thu Mar 5 08:46:07 2015 UTC (2 years, 6 months ago) by jcfr
COMP: Fix unused variable warning

Revision 24018  Directory Listing
Modified Thu Mar 5 08:46:05 2015 UTC (2 years, 6 months ago) by jcfr
STYLE: Remove unused dead code

Revision 24017  Directory Listing
Modified Thu Mar 5 08:45:43 2015 UTC (2 years, 6 months ago) by jcfr
ENH: Add qMRMLLayoutViewFactory

This gives the ability to instantiate a different QWidget for any view
(e.g. 3D, slice, chart). Limited support is given to handle a new type
view (subclass of vtkMRMLAbstractViewNode). For full support, the layout
logic would need a similar plugin mechanism.

/// MRML layout manager that instantiates the QT widgets and layouts from the
/// layout node and the view nodes in the scene.
/// The management (creation, configuration and deletion) of the view widgets
/// are delegated to qMRMLLayoutViewFactory.
/// Example to change a default factory:
/// \code
/// qMRMLLayoutSliceViewFactory* mrmlSliceViewFactory =
///   qobject_cast<qMRMLLayoutSliceViewFactory*>(
///     app->layoutManager()->mrmlViewFactory("vtkMRMLSliceNode"));
/// MySliceViewFactory* mySliceViewFactory =
///   new MySliceViewFactory(app->layoutManager());
/// mySliceViewFactory->setSliceLogics(mrmlSliceViewFactory->sliceLogics());
///
/// app->layoutManager()->unregisterViewFactory(mrmlSliceViewFactory);
/// app->layoutManager()->registerViewFactory(mySliceViewFactory);
/// \endcode
/// You can also register ctkLayoutViewFactories that are not related to MRML
/// view nodes.

From: Julien Finet <julien.finet@kitware.com>

Revision 23980  Directory Listing
Modified Tue Feb 24 18:12:00 2015 UTC (2 years, 7 months ago) by alexy
BUG: 3966. Mark scene as modified after a hierarchy node is re-parented. This is needed to mark scene as needed to save in the Save Data dialog.

Revision 23966  Directory Listing
Modified Sat Feb 7 19:45:11 2015 UTC (2 years, 7 months ago) by lassoan
ENH: Improved performance of transform widget

Only update transform info string if transform info section is shown.
Prevent firing duplicate transform modified event from the transform slider (when the transform was modified, the slider was updated, and the slider fired a transform modified event; now the slider only fires modified if the transform is actually changed)

Revision 23964  Directory Listing
Modified Thu Feb 5 21:22:34 2015 UTC (2 years, 7 months ago) by lassoan
BUG: Fixed warning in vtkMRMLSliceLogicTest2_fixed.nrrd test

Warnings caused by the test code expecting a binary image and the reslice filter providing a stencil as mask:

125: vtkMRMLScalarVolumeDisplayNode::pipeline updated: 0.000349045 fps: 2864.96
125: ERROR: In /home/jchris/Projects/Slicer-2-SuperBuild-Debug/VTKv6/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx, line 810
125: vtkCompositeDataPipeline (0x2cadda0): Input for connection index 0 on input port index 0 for algorithm vtkImageCast(0x2cabb40) is of type vtkImageStencilData, but a vtkImageData is required.
125: 
125: vtkMRMLScalarVolumeDisplayNode::window updated: 0.000169039 fps: 5915.8
125: ERROR: In /home/jchris/Projects/Slicer-2-SuperBuild-Debug/VTKv6/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx, line 810
125: vtkCompositeDataPipeline (0x2cadda0): Input for connection index 0 on input port index 0 for algorithm vtkImageCast(0x2cabb40) is of type vtkImageStencilData, but a vtkImageData is required.
125: 
125: vtkMRMLScalarVolumeDisplayNode::threshold updated: 0.000144958 fps: 6898.53
125: ERROR: In /home/jchris/Projects/Slicer-2-SuperBuild-Debug/VTKv6/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx, line 810
125: vtkCompositeDataPipeline (0x2cadda0): Input for connection index 0 on input port index 0 for algorithm vtkImageCast(0x2cabb40) is of type vtkImageStencilData, but a vtkImageData is required.
125: 
125: vtkMRMLScalarVolumeDisplayNode::alpha updated: 8.79765e-05 fps: 11366.7
1/1 Test #125: vtkMRMLSliceLogicTest2_fixed.nrrd ...   Passed    0.99 sec

After the fix there are no warnings anymore.

Revision 23961  Directory Listing
Modified Thu Feb 5 00:11:16 2015 UTC (2 years, 7 months ago) by jcfr
ENH: Improve build targets organization in IDE that support folders

This commit set the FOLDER property on all targets to group them
into meaningful "units". This will make development easier ensuring
it is possible to quickly re-build and open the source files associated
with the targets of either a given module, the core libraries or even
the Slicer application.

Currently the grouping is:
* App-SlicerApp
* CMakePredefinedTargets
* Core-Base
* Core-Libs
 * FreeSurfer
 * ITKFactoryRegistration
 * [...]
* Module-<NameOfModule>
* [...]

If for some reason, the folder organization needs to be disabled. Slicer
could be configured with Slicer_USE_FOLDERS set to OFF.

Projects updated in this commit:
* CTK
* SlicerExecutionModel
* OtsuThresholdImageFilter

Notes:

 (1) some of the targets (EMSegment, BRAINSTools, MultiVolume, ...)
are still associated to the root and not yet categorized.

 (2) ideally few more  macros/functions should be introduced: one to
easily configure subject hierarchy plugin, and one to easily configure
tests associated with a CLI.


CTK changes:

// -------------
commit commontk/CTK@ac1370e
Author: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Date:   Wed Feb 4 14:47:09 2015 -0500

    Add FOLDER parameter to ctkMacroBuildQtPlugin

    If specified, the target(s) associated with designer, icon engine and
    style plugins will be added into the specified folder when the project is
    configured for an IDE supporting it.

    For more details, see http://www.cmake.org/cmake/help/v2.8.9/cmake.html#prop_tgt:FOLDER
// -------------


SlicerExecutionModel changes:

// -------------
commit Slicer/SlicerExecutionModel@0b780eb
Author: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Date:   Wed Feb 4 18:06:25 2015 -0500

    ENH: SEMMacroBuildCLI - Add possibility to associate FOLDER with CLI targets

    In project building a lot of modules (i.e Slicer), whenever possible, it
    is better to keep the huge list of targets organized. To help with this,
    CMake allows to set a FOLDER target property.

    See http://www.cmake.org/cmake/help/v2.8.3/cmake.html#prop_tgt:FOLDER

    This commit extends the SEMMacroBuildCLI API to accept an optional FOLDER
    parameter. If not set, the folder name will default to:

      <SlicerExecutionModel_DEFAULT_CLI_TARGETS_FOLDER_PREFIX><MODULE_NAME>

    By default the prefix is set to an empty string and the folder will be
    named after the module name.

    There are two ways to specify a default prefix value:

     (1) Set the variable SlicerExecutionModel_DEFAULT_CLI_TARGETS_FOLDER_PREFIX
    in the current scope before calling 'SEMMacroBuildCLI'

     (2) Configure the SlicerExecutionModel project with the option
    SlicerExecutionModel_DEFAULT_CLI_TARGETS_FOLDER_PREFIX

    Note that:
     - FOLDER support has been introduced in CMake >= 2.8.3
    and
     - it can optionally be enabled in a project by setting the global
    property named USE_FOLDERS.

    See http://www.cmake.org/cmake/help/v2.8.3/cmake.html#prop_global:USE_FOLDERS

    Finally, to associate CLI test expected to be in the same "FOLDER",
    a variable named <MODULE_NAME>_TARGETS_FOLDER is conveniently set in the
    current scope each time the macro SEMMacroBuildCLI is called.

commit Slicer/SlicerExecutionModel@e84d231
Author: Matt McCormick <matt.mccormick@kitware.com>
Date:   Thu Aug 7 11:09:39 2014 -0400

    BUG: Fix ModuleDescriptionParser test data dir.

    Fixes Parser1Test{1,2}.

    Simplify by consolidation of variables.
// -------------


OtsuThresholdImageFilter changes:

// -------------
commit :Slicer/Slicer-OtsuThresholdImageFilter@5efe412
Author: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Date:   Wed Feb 4 18:08:28 2015 -0500

    Associate folder with test targets.
    [...]
// -------------

Revision 23951  Directory Listing
Modified Tue Feb 3 06:43:53 2015 UTC (2 years, 7 months ago) by jcfr
COMP: Fix redefined _POSIX_C_SOURCE warning in MRMLScriptedDisplayableManager

See previous commit message for more details.

Revision 23948  Directory Listing
Modified Tue Feb 3 05:41:54 2015 UTC (2 years, 7 months ago) by jcfr
STYLE: Fix parentheses warning in qMRMLSceneHierarchyModel

This commit fixes a warning introduced by r23845 (BUG: 3926. Added
null pointer checks into reparenting code.)

//----------------
/path/to/Slicer/Libs/MRML/Widgets/qMRMLSceneHierarchyModel.cxx: In member function ‘virtual bool qMRMLSceneHierarchyModel::reparent(vtkMRMLNode*, vtkMRMLNode*)’:
/path/to/Slicer/Libs/MRML/Widgets/qMRMLSceneHierarchyModel.cxx:306:39: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
       if (!hierarchyNode || newParent && strcmp(newParent->GetClassName(), hierarchyNode->GetClassName()))
                                       ^
//----------------

Revision 23944  Directory Listing
Modified Tue Feb 3 04:24:28 2015 UTC (2 years, 7 months ago) by jcfr
COMP: Fix VTKv5 build error associated with new reslice pipeline

This commit fixes build error introduced by the two previous commit
and happening when enabling VTKv5 build.

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 23943  Directory Listing
Modified Tue Feb 3 04:24:25 2015 UTC (2 years, 7 months ago) by jcfr
BUG: Fixed background image mask usage in all volume display nodes

From: Andras Lasso <lasso@queensu.ca>

Revision 23942  Directory Listing
Modified Tue Feb 3 04:24:20 2015 UTC (2 years, 7 months ago) by jcfr
ENH: Use the latest vtkImageReslice filter instead of vtkImageResliceMask

Features:

* Performance optimization: about 2x speed increase in slice rendering
  speed when the volume is linearly transformed (e.g., transformed MRHead
  refresh rate 25fps -> 50fps)

* Thick slices, MIP, DRR, etc. display modes are available (no GUI yet,
  but already can be enabled using Python), see the code samples below

Implementation:

* Convert composite transform to simple linear filter before setting it
  in the reslice filter (because vtkImageResliceMask can do some additional
  optimizations if it gets a simple linear transform)

* Use the latest vtkImageReslice filter instead of vtkImageResliceMask:
** mask output of vtkImageReslice is a stencil, therefore slice processing
   pipeline is simplified: vtkImageCast filter is not needed anymore and
   the more efficient vtkImageStencil is used instead of vtkImageMathematics
** custom vtkImageResliceMask class is removed: no need to maintain it
   any longer, etc.

Thick slice:

sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')
appLogic = slicer.app.applicationLogic()
sliceLogic = appLogic.GetSliceLogic(sliceNode)
sliceLayerLogic = sliceLogic.GetBackgroundLayer()
reslice = sliceLayerLogic.GetReslice()
reslice.SetSlabModeToMean()
reslice.SetSlabNumberOfSlices(10)
reslice.SetSlabSliceSpacingFraction(0.3)
sliceNode.Modified()

Maximum intensity projection (MIP):

sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')
appLogic = slicer.app.applicationLogic()
sliceLogic = appLogic.GetSliceLogic(sliceNode)
sliceLayerLogic = sliceLogic.GetBackgroundLayer()
reslice = sliceLayerLogic.GetReslice()
reslice.SetSlabModeToMax()
reslice.SetSlabNumberOfSlices(600)
reslice.SetSlabSliceSpacingFraction(0.5)
sliceNode.Modified()

Conflicts:
	Modules/Loadable/Volumes/Logic/vtkSlicerVolumesLogic.cxx

From: Andras Lasso <lasso@queensu.ca>

Revision 23931  Directory Listing
Modified Thu Jan 29 04:16:24 2015 UTC (2 years, 7 months ago) by jcfr
STYLE: Fixed typos in doxygen comments

From: Sergey Aleshin <4memph@gmail.com>

Revision 23930  Directory Listing
Modified Thu Jan 29 04:16:20 2015 UTC (2 years, 7 months ago) by jcfr
COMP: Add missing definition for qMRMLThreeDWidget::threeDController

From: Sergey Aleshin <4memph@gmail.com>

Revision 23929  Directory Listing
Modified Thu Jan 29 04:13:47 2015 UTC (2 years, 7 months ago) by jcfr
STYLE: Fix "constness" of qMRMLSliceWidget::sliceView

From: Sergey Aleshin <4memph@gmail.com>

Revision 23923  Directory Listing
Modified Thu Jan 29 00:31:48 2015 UTC (2 years, 7 months ago) by naucoin
BUG: user loaded color files don't need to be singletons

The load data dialogue uses the color logic methods to load in
color files. These methods were originally written to load the
built in color files and have variables set that need to be
unset for user files. The singleton tag needs to be unset for
user loaded files or else they won't be cleared out of the
scene on close and can cause unexpected behaviour when
saved in MRBs.


Revision 23909  Directory Listing
Modified Fri Jan 23 08:05:15 2015 UTC (2 years, 8 months ago) by jcfr
STYLE: Fix indent and provide clarification related to previous commit.

The vtkImageAccumulate filter has been fixed in kitware/VTK@a952720

Revision 23908  Directory Listing
Modified Fri Jan 23 07:54:15 2015 UTC (2 years, 8 months ago) by jcfr
BUG: Fix vtkImageBimodalAnalysis to work with any input scalar type

Following kitware/VTK@238163f, the vtkImageAccumulate filter has been
fixed to work with large images by changing its output type from "int"
to "vtkIdType".

Considering that

  (1) the output of the vtkImageAccumulate filter was the input of
the  vtkImageBimodalAnalysis filter

and

  (2)  the vtkImageBimodalAnalysis "ExecuteData" function didn't specify
the vtkIdType scalar type in its list of hard-coded switch cases

The window and level computed by the bimodal filter were 0 and the ad-hoc
approach was then used to compute the windows and level.

This commit fixes the problem by updating the bimodal filter to use
the vtkTemplateMacro avoiding to systematically list all cases.

Revision 23907  Directory Listing
Modified Fri Jan 23 07:54:13 2015 UTC (2 years, 8 months ago) by jcfr
COMP: Fix unused parameter warning in vtkITKTransformInverse

Revision 23905  Directory Listing
Modified Thu Jan 22 15:01:20 2015 UTC (2 years, 8 months ago) by lassoan
ENH: Changed default ITK bspline transform writing file format to ITKv4

BRAINS now fully supports the new ITKv4 bspline and composite transform file formats therefore by default PreferITKv3CompatibleTransforms flag in vtkMRMLTransformStorageNode can be turned off.
From now on, if a bspline transform can be saved in both ITKv3 and ITKv4 format then ITKv4 format is used.

Revision 23903  Directory Listing
Modified Thu Jan 22 08:34:44 2015 UTC (2 years, 8 months ago) by jcfr
COMP: Fix unused variable warning in qMRMLTreeView

This commit fixes the following warning:

//-----------
/path/to/Slicer/Libs/MRML/Widgets/qMRMLTreeView.cxx:429:6: warning: unused parameter ‘deselected’ [-Wunused-parameter]
 void qMRMLTreeView::onSelectionChanged(const QItemSelection & selected,
//-----------

Revision 23857  Directory Listing
Modified Thu Jan 8 17:49:00 2015 UTC (2 years, 8 months ago) by jcfr
COMP: Deprecate ITK function ::Zero and ::One to fix clang link error

These were deprecated in 2012; just before the ITK 4.2 release.
ZeroValue() and OneValue() should be used instead.

-- This coforms to ITKv4 changes made in
    InsightSoftwareConsortium/ITK@6c23e1da
    InsightSoftwareConsortium/ITK@3f712cd0

When building with clang on 10.9 where ITKv4 is a shared library,
a linking error occured for unfound symbols: NumericTraits<
OutputPixelType >::Zero but using the
NumericTraits< OutputPixelType >::ZeroValue() allows linkage to occur properly.

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 23852  Directory Listing
Modified Tue Jan 6 16:50:13 2015 UTC (2 years, 8 months ago) by naucoin
BUG: update camera displayable manager test MRML file

Place mode persistence was added to the interaction node in
svn 23772, update the baseline MRML file for this
test to comply to the current MRML scene.
Fixes vtkMRMLCameraDisplayableManagerTest1


Revision 23846  Directory Listing
Modified Tue Dec 30 15:44:32 2014 UTC (2 years, 8 months ago) by alexy
BUG: 3925. Added logic for propagating color and opacity to fiber hierarchies

Revision 23845  Directory Listing
Modified Tue Dec 30 15:38:41 2014 UTC (2 years, 8 months ago) by alexy
BUG: 3926. Added null pointer checks into reparenting code.

Revision 23843  Directory Listing
Modified Tue Dec 23 01:19:42 2014 UTC (2 years, 9 months ago) by jcfr
COMP: Fix wrapping of Slicer/ThreeD displayable manager factory with VTKv6

This commit fixes a regression introduced by r23838 (which was known
to work with VTKv5)

Revision 23840  Directory Listing
Modified Sun Dec 21 03:11:08 2014 UTC (2 years, 9 months ago) by jcfr
BUG: Fixed crash on scene close

Node pointers in the scene model can become invalid when the scene is closed.
If the node is looked up by node ID and pointer is retrieved from the scene then the retrieved pointer will always be valid.
The d->MRMLScene->GetNodeByID() lookup takes some extra time, but it is not very slow, because it just finds a string in a std::map<string,...>.

From: Andras Lasso <lasso@queensu.ca>

Revision 23839  Directory Listing
Modified Sun Dec 21 03:11:06 2014 UTC (2 years, 9 months ago) by jcfr
STYLE: More explicit debug message in displayable manager group

The class name of the registered displayable manager is displayed.

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 23838  Directory Listing
Modified Sun Dec 21 03:11:03 2014 UTC (2 years, 9 months ago) by jcfr
ENH: Allow displayable manager to be introspected using python

This is particularly useful when debugging issues.

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 23826  Directory Listing
Modified Wed Dec 10 21:12:21 2014 UTC (2 years, 9 months ago) by jcfr
ENH: Added support for thin plate spline transforms

Added full support for thin plate spline transforms:
* save/load forward and inverse transform from ITK files
* verification that ITK and VTK thin plate spline transform computes exactly the same values
* basic storage and inversion tests

Thin plate spline transform is used by the Landmark Registration module, so now the computed transform can be saved to the scene or exported.

From: Andras Lasso <lasso@queensu.ca>

Revision 23821  Directory Listing
Modified Tue Dec 9 15:35:55 2014 UTC (2 years, 9 months ago) by pinter
BUG: Fix mixing subject hierarchy with other hierarchies

Two fixes have been applied. One is to enforce nested associations if there is a conflict of two hierarchy nodes associating to one data node.
Reminder: Nested associations prevent the scenario when two hierarchy nodes associate to the same data node, which leads to non-determinism if GetAssociatedHierarchyNode is called. In this case instead of the connections (SH --assoc--> Model <--assoc-- ModelHierarchy), this structure is created: SH --assoc--> ModelHierarchy --assoc--> Model
The other fix is to ensure reparenting to the same type of hierarchy nodes. If this proves to be too strict, then we may allow reparenting to base classes, or the alternative is to subclass the scene hierarchy model to the hierarchy types.

Also a subject hierarchy bug was fixed that occurred because the widget was created when instantiating the module (which is udesirable by itself), and this caused creation of context menu actions before external plugins had the chance to register. Now the widget is not created early, but the right connections are made at the right time.

Fixes #3911

Revision 23817  Directory Listing
Modified Fri Dec 5 17:25:20 2014 UTC (2 years, 9 months ago) by pinter
ENH: Subject hierarchy nodes not auto-created by default

Subject hierarchy auto-creation has caused problems in other modules (like Models, see referred ticket), and some users won't use subject hierarchy, so the supported data nodes are not added to the hierarchy automatically.
Now when the user enters subject hierarchy, and there are supported nodes (i.e. there is an SH plugin that can handle the node) in the scene, a question pops up whether the user wants to create subject hierarchy. If they say no, the hierarchy remains empty and unusable, if they choose yes, then the hierarchy is created once, if they choose yes to all, then a setting is saved and auto-creation is turned on, which means every added node that is supported by SH is automatically added. The users who use subject hierarchy often, should choose this option.

Related to #3911

Revision 23813  Directory Listing
Modified Tue Dec 2 20:45:15 2014 UTC (2 years, 9 months ago) by alexy
BUG: 3911. Fixed crash on change of visibility of ModelHierarchy nodes introduced by making them part of SubjectHierarchy.

Revision 23808  Directory Listing
Modified Thu Nov 27 15:38:21 2014 UTC (2 years, 9 months ago) by alexy
BUG: 3905. Fixed visibility control logic for model hierarchy nodes.

Revision 23807  Directory Listing
Modified Thu Nov 27 03:39:59 2014 UTC (2 years, 9 months ago) by lassoan
BUG: Fixed composite transform problems

By hardening a non-linear transform on a vtkMRMLLinearTransformNode makes the contents of the linear transform node non-linear. This causes errors in many places in the code where linearity of the transform is tested by checking the class type instead of calling transform->IsLinear() or transform->IsTransformToParentLinear().

In the long term all specific transform nodes (linear, bspline, grid) should be removed and only the generic vtkMRMLTransformNode should be used everywhere. The specific classes are already “empty”, they do not contain any useful functionality, but they are be used in extensions (and still have not removed from everywhere in the Slicer core), so they have to be phased out gradually.

Specific problems:
* If affine transform is applied to bspline then bspline component is ignored
* If affine transform is applied to bspline and affine is hardened then the bspline component is lost.
* Hardening multiple nonlinear transforms on a transform sometimes results in incorrect composite transform

Fixes:
* Instead of casting to vtkMRMLLinearTransform IsLinear or IsTransformToWorldLinear has to be called to decide if a transform is linear (checking the class type does not work correctly for composite transforms)
* Fixed vtkMRMLTransformNode::ApplyTransform
* Moved full implementation of get/set transform matrix functions in vtkMRMLTransformNode (it further prepares removal of obsolete linear/bspline/grid transform node classes)

Enhancements:
* Allow splitting of composite transforms to its components (Transforms module: Split button – only displayed for composite transforms)

Revision 23804  Directory Listing
Modified Wed Nov 26 21:02:30 2014 UTC (2 years, 9 months ago) by lassoan
BUG: Fixed crash when slice compositing option is changed

vtkNew pointer was deleted with Delete().
Fixes http://na-mic.org/Mantis/view.php?id=3904

Revision 23803  Directory Listing
Modified Wed Nov 26 20:59:27 2014 UTC (2 years, 9 months ago) by lassoan
BUG: Fixed slice intersection display of non-linearly transformed model nodes

An additional polydata transform filter is added to the pipeline that applies the model-to-world transform to the model's polydata.
Fixes http://www.na-mic.org/Bug/view.php?id=3900

Revision 23790  Directory Listing
Modified Tue Nov 18 18:42:36 2014 UTC (2 years, 10 months ago) by pinter
ENH: Added Transforms subject hierarchy plugin

Now the transforms are also displayed in subject hierarchy as nodes. Their tooltip shows relevant information, can be visualized via the regular show/hide buttons, and context menu includes Invert and Reset to identity features.

Revision 23789  Directory Listing
Modified Tue Nov 18 16:05:19 2014 UTC (2 years, 10 months ago) by alexy
BUG: fixed typos in comments.

Revision 23788  Directory Listing
Modified Tue Nov 18 15:19:13 2014 UTC (2 years, 10 months ago) by alexy
BUG 3678. Fixed multiple issues with Tractography Fibers in the Models module. Added support for Fiber Hierarchies in the Models Module. Added Line/Tube/Glyph selection for display node tree view and display property editors in Models module. Made global visibility work for Fibers and the hierarchies of fibers. Synchronized tree view and display property editor. Added Line/Tube/Glyph selection to vtkMRMLSelection node, it is used in the tree view and display property editors and DisplayableManager.Also added generic Get/SetDisplayClassVisibility() methods to vtkMRMLDisplayNode.

Revision 23787  Directory Listing
Modified Tue Nov 18 15:05:54 2014 UTC (2 years, 10 months ago) by alexy
BUG: 3863. Fixed the logic for passing the scalars in vtkPolyDataTensorToColor to prevent uninitialized data array

Revision 23772  Directory Listing
Modified Sat Nov 1 02:53:25 2014 UTC (2 years, 10 months ago) by jcfr
ENH: Save vtkMRMLInteractionNode::PlaceModePersistence in the scene

From: Andras Lasso <lasso@queensu.ca>

Revision 23767  Directory Listing
Modified Thu Oct 30 09:07:40 2014 UTC (2 years, 10 months ago) by jcfr
COMP: Fix VS2013 compilation error including missing algorithm header

From: Dzenan Zukic <dzenan.zukic@kitware.com>

Revision 23763  Directory Listing
Modified Wed Oct 29 21:49:07 2014 UTC (2 years, 10 months ago) by naucoin
BUG: fix crash when editing scripted screen shots

Fixed the default screen shot type to use the defined full layout
integer.
Added checks to avoid crashes for scripts that are in extensions.

The default screen shot type was set to -1 in the python scripts
and templates, but in the Qt widget, the screen shot type was
only defined from 0-4. Trying to open the scripted screen shot
node in the Qt widget would cause a crash since the -1 type was
cast to the enumerated WidgetType in qMRMLScreenShotDialog
resulting in an invalid number and a null widget.

Issue #3879

Revision 23759  Directory Listing
Modified Wed Oct 29 05:24:47 2014 UTC (2 years, 10 months ago) by jcfr
BUG: Increase maximum value for dimension widget in volume info. Fixes #3790

This commit changes the maximum value from "100000" to "1000000'

Revision 23734  Directory Listing
Modified Wed Oct 1 03:30:39 2014 UTC (2 years, 11 months ago) by finetjul
BUG: Do not use QItemSelectionModel::currentRowChanged()

The signal is not reliable, ot might not be triggered at the right time.
Indeed the signal is for "key" events and has not a "selection" role.
The lack of trigger can lead to a crash due to widgets still observing
nodes that are not in the scene anymore.

Revision 23729  Directory Listing
Modified Thu Sep 25 19:49:02 2014 UTC (3 years ago) by jcfr
COMP: Remove dependency on ITKDeprecated. See #3830

This commit updates ITK to include custom Slicer patch ensuring that
independently of the value of the ITKV3_COMPATIBILITY option,
ITKDeprecated is not include in the list of default modules.

It updates

  (1) BRAINSTools to remove ITKDeprecated from the list
      of required ITK components.

  (2) EMSegment to explicitly call find_package(ITK..) and use
      ITK_LIBRARIES variable when executable and library are added.

Note that at the time of this commit the pull request updating the
LASegmenter extension  to remove ITKDeprecated dependency is pending.
See https://github.com/ljzhu/LASegmenter/pull/2

// -------------
BRAINSTools updates:

$ git shortlog 6f99866..b82c7c8
Jean-Christophe Fillion-Robin (1):
      COMP: Remove ITKDeprecated from the list of ITK components.

// -------------
ITKv4 updates:

$ git shortlog baf8174bb..56fae278
Jean-Christophe Fillion-Robin (1):
      Ensure ITKDeprecated is always excluded from the default module list.

Revision 23720  Directory Listing
Modified Tue Sep 23 02:31:02 2014 UTC (3 years ago) by jcfr
STYLE: Fix spelling of variable "childern" -> "children"

Revision 23719  Directory Listing
Modified Tue Sep 23 02:30:58 2014 UTC (3 years ago) by jcfr
BUG: Associate ChildNodeRemovedEvent with RemoveAllHierarchyChildrenNodes

See #3854

This commit ensure the event "ChildNodeRemovedEvent" is invoked
for each child removed using the method RemoveAllHierarchyChildrenNodes.

Thanks to "Nicole Aucoin <nicole@bwh.harvard.edu>" and
"Csaba Pinter <csaba.pinter@queensu.ca>" for reviewing the associated
changes.

Revision 23718  Directory Listing
Modified Tue Sep 23 02:30:55 2014 UTC (3 years ago) by jcfr
BUG: Fix RemoveHierarchyChildrenNodes to send correct ChildNodeRemovedEvent

See #3854

This commit udpates the method so that the event "ChildNodeRemovedEvent"
is send for each child that has been removed. It also associate the
appropriate call data.

Thanks to "Nicole Aucoin <nicole@bwh.harvard.edu>" and
"Csaba Pinter <csaba.pinter@queensu.ca>" for reviewing the associated
changes.

Revision 23717  Directory Listing
Modified Sat Sep 20 06:37:40 2014 UTC (3 years ago) by jcfr
COMP: Fix vtkITK windows build error when ITK_USE_64BITS_IDS is ON. See #3825

Thanks to "Gib Bogle <g.bogle@auckland.ac.nz>" for reporting the issue and
testing the patch.

The build error fixed by this commit was:

32>    vtkITKTimeSeriesDatabase.cxx
32>c:\slicer\libs\vtkitk\itkTimeSeriesDatabase.txx(34): error C2782: 'T itk::TSD_MAX(T,T)' : template parameter 'T' is ambiguous [C:\s\b\Slicer-build\Libs\vtkITK\vtkITK.vcxproj]
32>            c:\slicer\libs\vtkitk\itkTimeSeriesDatabase.txx(19) : see declaration of 'itk::TSD_MAX'
32>            could be 'itk::Size<VDimension>::SizeValueType'
32>            with
32>            [
32>                VDimension=3
32>            ]
32>            or       'itk::IndexValueType'
32>            c:\slicer\libs\vtkitk\itkTimeSeriesDatabase.txx(27) : while compiling class template member function 'bool itk::TimeSeriesDatabase<TPixel>::CalculateIntersection(itk::Size<VDimension>,itk::ImageRegion<VImageDimension>,itk::ImageRegion<VImageDimension> &,itk::ImageRegion<VImageDimension> &)'
32>            with
32>            [
32>                TPixel=vtkITKTimeSeriesDatabase::OutputImagePixelType,
32>                VDimension=3,
32>                VImageDimension=3
32>            ]
32>            c:\slicer\libs\vtkitk\itkTimeSeriesDatabase.txx(344) : while compiling class template member function 'void itk::TimeSeriesDatabase<TPixel>::CreateFromFileArchetype(const char *,const char *)'
32>            with
32>            [
32>                TPixel=vtkITKTimeSeriesDatabase::OutputImagePixelType
32>            ]
32>            c:\slicer\libs\vtkitk\vtkITKTimeSeriesDatabase.h(89) : see reference to class template instantiation 'itk::TimeSeriesDatabase<TPixel>' being compiled
32>            with
32>            [
32>                TPixel=vtkITKTimeSeriesDatabase::OutputImagePixelType
32>            ]
32>c:\slicer\libs\vtkitk\itkTimeSeriesDatabase.txx(41): error C2782: 'T itk::TSD_MIN(T,T)' : template parameter 'T' is ambiguous [C:\s\b\Slicer-build\Libs\vtkITK\vtkITK.vcxproj]
32>            c:\slicer\libs\vtkitk\itkTimeSeriesDatabase.txx(18) : see declaration of 'itk::TSD_MIN'
32>            could be 'itk::Size<VDimension>::SizeValueType'
32>            with
32>            [
32>                VDimension=3
32>            ]
32>            or       'itk::IndexValueType'
32>  Done Building Project "C:\s\b\Slicer-build\Libs\vtkITK\vtkITK.vcxproj" (default targets) -- FAILED.

Revision 23714  Directory Listing
Modified Sat Sep 20 01:57:00 2014 UTC (3 years ago) by jcfr
COMP: Fix compilation errors with ITK_USE_64BITS_IDS

Enabling this cmake configuration flag for ITK changes the size types
used in ITK from ulong to ulong long on windows. This patch addresses
compilation errors which resulted from this change. The
itk::SizeValueType is preferred type, or a referenced typedef from the
related ITK class being used.

For reference, see :
  http://slicer-devel.65872.n3.nabble.com/Building-Slicer-with-ITK-USE-64BIT-IDS-tt4032499.html
  http://slicer-devel.65872.n3.nabble.com/BigTIFF-tt4032353.html

From: Bradley Lowekamp <blowekamp@mail.nih.gov>

Revision 23699  Directory Listing
Modified Wed Sep 17 22:28:40 2014 UTC (3 years ago) by jcfr
ENH: Simplify vtkSeedTracts::TransformStreamlinesToRASAndAppendToPolyData

This commit updates the function to use vtkNew and simplifies the code
by removing redundant calls.

Revision 23698  Directory Listing
Modified Wed Sep 17 22:28:38 2014 UTC (3 years ago) by jcfr
STYLE: Use vtkNew in vtkSeedTract/vtkDiffusionTensorGlyph/...

This commit simplifies code using vtkNew where it makes sense.

Revision 23695  Directory Listing
Modified Wed Sep 17 12:40:45 2014 UTC (3 years ago) by jcfr
BUG: Update diffusion tensor reader to force origin/spacing. Fixes #3845

This commit fixes a regression introduced in r23122 and forces the
origin/spacing for VTK 6 similarly to what was done for VTK 5.

Revision 23694  Directory Listing
Modified Wed Sep 17 12:40:43 2014 UTC (3 years ago) by jcfr
BUG: Fix return value in diffusion tensor reader "RequestData()"

Revision 23693  Directory Listing
Modified Wed Sep 17 12:40:42 2014 UTC (3 years ago) by jcfr
ENH: Simplify Diffusion tensor reader using FindPoint with both VTK 5 and 6

Revision 23690  Directory Listing
Modified Wed Sep 17 12:40:36 2014 UTC (3 years ago) by jcfr
BUG: Re-organize tractography seeding pipeline to work with VTK6. See #3845

This commit fixes pipeline incorrectly setup in r23121 by using output
port instead pipeline information (InputROIPipelineInfo)

Revision 23689  Directory Listing
Modified Wed Sep 17 12:40:33 2014 UTC (3 years ago) by jcfr
STYLE: Remove unused code from vtkSeedTracts

Extent from the input tensor field was not used.

Revision 23680  Directory Listing
Modified Mon Sep 15 22:00:44 2014 UTC (3 years ago) by pieper
BUG: #3846 fixes crash when trying to use label map seeding

With the change to VTKv6 some member variables can be null, probably
due to the tensor pipeline not being correctly initialized.

This avoids the crash, but issue #3846 is not fixed (tractography
does not work).

From: Steve Pieper <pieper@bwh.harvard.edu>

Revision 23663  Directory Listing
Modified Tue Sep 9 21:03:03 2014 UTC (3 years ago) by jcfr
ENH: Remove unused method Register/UnRegisterExtraBuiltInFactories

Originally introduced in r2733, after previous commit, these methods
are not needed anymore.

Revision 23662  Directory Listing
Modified Tue Sep 9 21:02:49 2014 UTC (3 years ago) by jcfr
ENH: In ITK 4.6, ImageIO GE5 is now registered by default.

No need to manually register the GE5 ImageIO because as of ITK 4.6 it
is registered by default with ITK.

Let's note the GE IO module is enabled by default and there is not need
to explicitly enable it when configuring ITK.

See InsightSoftwareConsortium/ITK@80cacdc

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Bradley Lowekamp <blowekamp@mail.nih.gov>

Revision 23661  Directory Listing
Modified Tue Sep 9 20:56:52 2014 UTC (3 years ago) by jcfr
ENH: Change required ITK version from 4.5 to 4.6

Starting with r23373 ITK 4.6.x is used to build and test Slicer.

$ git shortlog c127db8..6b5fa1a SuperBuild/External_ITKv4.cmake
jcfr (8):
      ENH: Update (1) ITKv4 from v4.5.2 to v4.6rc01 and (2) update BRAINSTools
      BUG: Update ITKv4 project to backport fix related to GDCMIO
      BUG: Update ITKv4 - Attempt to fix ResampleDTI tests
      COMP: Update ITKv4 - Fix "unused-local-typedefs" warning
      COMP: Move most of find_package calls into each Slicer sub-project.
      ENH: Move ITKv4 towards 4.6.0rc20140719
      ENH: Update ITKv4 and BRAINSTools
      BUG: Update ITKv4 and BRAINSTools - BRAINSFit performance improvement.

Revision 23660  Directory Listing
Modified Tue Sep 9 19:54:01 2014 UTC (3 years ago) by jcfr
ENH: Remove ITK AnalyzeImageIO registration

Originally introduced in r824, the ITK AnalyzeImageIO have been
deprecated. The NIFTI ImageIO implementation is now able to read
analyze .img or .hdr files as well as the original Analyze ImageIO.

From: Bradley Lowekamp <blowekamp@mail.nih.gov>

Revision 23619  Directory Listing
Modified Tue Aug 26 23:41:12 2014 UTC (3 years, 1 month ago) by jcfr
COMP: Link against vtkWrappingPythonCore to use vtkPythonUtil fucntions

Revision 23612  Directory Listing
Modified Fri Aug 22 20:26:28 2014 UTC (3 years, 1 month ago) by pieper
ENH: Add Slice Annotations to DataProbe module

This commit enhance the DataProbe module providing an
easy way to show/hide/customize corner annotations, ruler and color bar in the
Slice viewers.

Associated setting are saved in the general settings common to
all version of Slicer installed on the workstation.

The implementation of slice view annotations in DataProbe is a part of QIICR Project [1] includes the following features:

* Corner text annotations including basic DICOM annotations.
* Interactive Color scalar bar widget for background and foreground volumes.
* Scaling ruler

[1] QIICR Slicer infrastructure projects

ENH: Add method vtkMRMLSliceLogic::GetForegroundWindowLevelAndRange

STYLE: Remove dead code

ENH: Added the following enhancements and fixes

* Added color scalar bar actors to color bar widget instead of adding it
directly to renderer. The user can move the color bar now.
* The height of color bar is now sensitive to the top right annotations.
When top right is deactive the height would be almost 100%
* Replaced the hard-coded UI with Qt Designer UI file.
* Fixed the vtk warning:
                   vtkTextActor::SetInput was passed an uninitialized
		   string
* Fixed issues with user settings
* An option added to have persistent background layer dicom annotation.
* Restore default values for all of the default settings was added.

ENH: Modified the logic to use dicom tag cache and the following fixes:

* Added dialog box for notifying slicer users about the new slice
 annotation feature
* Made Color Scalar bar off in default mode
* Code refactored in creating lines for ruler and other minor bugs fixed

From: Alireza Mehrtash <mehrtash@bwh.harvard.edu>

Revision 23607  Directory Listing
Modified Wed Aug 20 21:27:03 2014 UTC (3 years, 1 month ago) by jcfr
COMP: Fix overloaded-virtual warnings in vtkITKTransformInverse

This commit fixes warnings of the following form:

In file included from /path/to/ITKv4/Modules/Core/Transform/include/itkBSplineDeformableTransform.h:370:0,
                 from /path/to/Slicer/Libs/MRML/Core/vtkITKTransformConverter.h:27,
                 from /path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:31:
/path/to/Slicer/Libs/MRML/Core/vtkITKTransformInverse.h: In instantiation of ‘class itk::InverseBSplineDeformableTransform<float, 3u, 3u>’:
/path/to/ITKv4/Modules/IO/TransformBase/include/itkTransformFactory.h:46:25:   required from ‘static void itk::TransformFactory<T>::RegisterTransform() [with T = itk::InverseBSplineDeformableTransform<float, 3u, 3u>]’
/path/to/Slicer/Libs/MRML/Core/vtkITKTransformConverter.h:117:65:   required from here
/path/to/ITKv4/Modules/Core/Transform/include/itkBSplineDeformableTransform.hxx:493:1: warning: ‘void itk::BSplineDeformableTransform<TScalar, NDimensions, VSplineOrder>::TransformPoint(const InputPointType&, itk::BSplineDeformableTransform<TScalar, NDimensions, VSplineOrder>::OutputPointType&, itk::BSplineDeformableTransform<TScalar, NDimensions, VSplineOrder>::WeightsType&, itk::BSplineDeformableTransform<TScalar, NDimensions, VSplineOrder>::ParameterIndexArrayType&, bool&) const [with TScalar = float; unsigned int NDimensions = 3u; unsigned int VSplineOrder = 3u; itk::BSplineDeformableTransform<TScalar, NDimensions, VSplineOrder>::InputPointType = itk::Point<float, 3u>; itk::BSplineDeformableTransform<TScalar, NDimensions, VSplineOrder>::OutputPointType = itk::Point<float, 3u>; itk::BSplineDeformableTransform<TScalar, NDimensions, VSplineOrder>::WeightsType = itk::Array<double>; itk::BSplineDeformableTransform<TScalar, NDimensions, VSplineOrder>::ParameterIndexArrayType = itk::Array<long unsigned int>]’ was hidden [-Woverloaded-virtual]
 BSplineDeformableTransform<TScalar, NDimensions, VSplineOrder>

Revision 23606  Directory Listing
Modified Wed Aug 20 21:27:01 2014 UTC (3 years, 1 month ago) by jcfr
COMP: Fix unused variable warning in vtkITKTransformConverter

Revision 23605  Directory Listing
Modified Wed Aug 20 21:26:59 2014 UTC (3 years, 1 month ago) by jcfr
COMP: Fix unused parameter warnings in vtkITKTransformInverse

Revision 23604  Directory Listing
Modified Wed Aug 20 21:26:57 2014 UTC (3 years, 1 month ago) by jcfr
COMP: Fix unused local typedefs warning in vtkMRMLTransformStorageNode

Revision 23591  Directory Listing
Modified Tue Aug 19 19:43:22 2014 UTC (3 years, 1 month ago) by lassoan
ENH: Made BSplineDeformableTransform (ITKv3) the default write option for bspline transforms

Added a new attribute to vtkMRMLTransformStorageNode: PreferITKv3CompatibleTransforms.
By default PreferITKv3CompatibleTransforms=1 and so bsplines are written as BSplineDeformableTransform (ITKv3).
If PreferITKv3CompatibleTransforms=0 then bsplines are written as BSplineTransform (ITKv4).

When most of the modules support ITKv4 then the default writing format can be changed by setting
PreferITKv3CompatibleTransforms=0 in the vtkMRMLTransformStorageNode constructor.

Revision 23587  Directory Listing
Modified Mon Aug 18 01:39:01 2014 UTC (3 years, 1 month ago) by lassoan
BUG: Fix compatibility with recent scenes containing inverted linear transforms

Revision 23586  Directory Listing
Modified Sun Aug 17 23:54:35 2014 UTC (3 years, 1 month ago) by lassoan
BUG: Fixed crash in vtkMRMLNode reference adding

Crashed when attempting to add a new reference with NULL referenced node pointer.

Caused the vtkMRMLNodeTest1 dashboard test to fail:

http://slicer.cdash.org/testDetails.php?test=5647387&build=259092

Test: vtkMRMLNodeTest1 (Failed) 
Build: Windows7-VS2008-64bits-QT4.8.6-NoVTKDebugLeaks-NoConsole-Release (factory-south-win7.kitware) on 2014-08-16 00:08:18
Repository revision: 23570

C:\D\N\Slicer-1-build\Slicer-build\Slicer.exe "--launcher-no-splash" "--launch" "C:/D/N/Slicer-1-build/Slicer-build/bin/Release/MRMLCoreCxxTests.exe" "vtkMRMLNodeTest1"


Test outputvtkMRMLNodeTestHelper1 (00000000038A8CA0)
  Debug: Off
  Modified Time: 16
  Reference Count: 1
  Registered Events: (none)
  ID: (none)
  Indent:      0
  Name: (none)
  Description: (none)
  SingletonTag: (none)
  HideFromEditors: 0
  Selectable: 1
  Selected: 0

Name of Class = vtkMRMLNodeTestHelper1
Name of Superclass = vtkMRMLNodeTestHelper1
WriteXML output:
 id="vtkMRMLNodeTest1" name="MyName" description="Testing a mrml node" hideFromEditors="false" selectable="true" selected="true" attributes="attName:attValue"
ERROR: In ..\..\..\..\..\Slicer-1\Libs\MRML\Core\vtkMRMLNode.cxx, line 815
vtkMRMLNodeTestHelper1 (00000000038A0080): GetAttribute: Name parameter is expected to be non NULL.

ERROR: In ..\..\..\..\..\Slicer-1\Libs\MRML\Core\vtkMRMLNode.cxx, line 820
vtkMRMLNodeTestHelper1 (00000000038A0080): GetAttribute: Name parameter is expected to have at least one character.

error: [C:/D/N/Slicer-1-build/Slicer-build/bin/Release/MRMLCoreCxxTests.exe] exit abnormally - Report the problem.

Revision 23585  Directory Listing
Modified Sun Aug 17 23:46:04 2014 UTC (3 years, 1 month ago) by jcfr
COMP: Fixes vtkITKTransform classes MacOSX compilation errors. See #3788

From: Steve Pieper <pieper@bwh.harvard.edu>

Revision 23584  Directory Listing
Modified Sun Aug 17 23:46:01 2014 UTC (3 years, 1 month ago) by jcfr
BUG: Fixed shared memory image IO error. See #3788

Due to a copy-paste error a static ITK transform was instantiated,
which broke image IO (probably some static initialization race condition).

From: Andras Lasso <lasso@queensu.ca>

Revision 23583  Directory Listing
Modified Sun Aug 17 23:45:59 2014 UTC (3 years, 1 month ago) by jcfr
ENH: Linear transforms now use vtkTransform for transform storage. See #3788

Main limitation was that the vtkMatrixToLinearTransform did not
have a GetInverseFlag() method.

Couple of other smaller fixes.

From: Andras Lasso <lasso@queensu.ca>

Revision 23582  Directory Listing
Modified Sun Aug 17 23:45:55 2014 UTC (3 years, 1 month ago) by jcfr
ENH: Always save transforms as FromParent. See #3788

Kept readWriteTransformAsToParent flag just for backward
compatibility, when reading an old scene.

If in the future we want to save the ToParent transform or
both FromParent and ToParent then the flag has to be added
to the storage node (and not the transform node).

From: Andras Lasso <lasso@queensu.ca>

Revision 23581  Directory Listing
Modified Sun Aug 17 23:30:35 2014 UTC (3 years, 1 month ago) by jcfr
ENH: Implemented inverse ITK transform reading and writing. See #3788

From: Andras Lasso <lasso@queensu.ca>

Revision 23580  Directory Listing
Modified Sun Aug 17 23:30:31 2014 UTC (3 years, 1 month ago) by jcfr
ENH: Always send transform "from parent" to CLI. See #3788

From: Andras Lasso <lasso@queensu.ca>

Revision 23579  Directory Listing
Modified Sun Aug 17 23:30:28 2014 UTC (3 years, 1 month ago) by jcfr
ENH: Simplified transform storage node. See #3788

From: Andras Lasso <lasso@queensu.ca>

Revision 23578  Directory Listing
Modified Sun Aug 17 23:30:24 2014 UTC (3 years, 1 month ago) by jcfr
ENH: Added grid transform reading-writing from h5 file. See #3788

From: Andras Lasso <lasso@queensu.ca>

Revision 23577  Directory Listing
Modified Sun Aug 17 23:30:21 2014 UTC (3 years, 1 month ago) by jcfr
ENH: Refactored ITK-VTK transform conversion code. See #3788

Moved low-level conversion functions to separate class.
Reduced redundancy between ITKv3 and ITKv4 converters.

From: Andras Lasso <lasso@queensu.ca>

Revision 23576  Directory Listing
Modified Sun Aug 17 23:30:18 2014 UTC (3 years, 1 month ago) by jcfr
ENH: Implemented composite transform reading. See #3788

Not just BSpline but any combination of bspline and linear
can be read from composite transforms.

Reading of grid transforms from transform file is not implemented yet.

From: Andras Lasso <lasso@queensu.ca>

Revision 23575  Directory Listing
Modified Sun Aug 17 23:30:15 2014 UTC (3 years, 1 month ago) by jcfr
ENH: Any kind of linear transform is usable as bspline bulk. See #3788

From: Andras Lasso <lasso@queensu.ca>

Revision 23574  Directory Listing
Modified Sun Aug 17 23:30:12 2014 UTC (3 years, 1 month ago) by jcfr
ENH: WIP - Add .h5 formated transform storage of BSplines. See #3788

Partial implementation for reading itkBSplineTransform (for ITKv4)

Mostly implemented but the transform that gets read in is identity
and not the one in the file. Probably something wrong with
this cast:

+  typedef itk::BSplineTransform< T,VTKDimension,BSPLINE_TRANSFORM_ORDER > BSplineTransformType;
+  typename BSplineTransformType::Pointer bsplineItk =
+    dynamic_cast< BSplineTransformType* >( warpTransformItk.GetPointer() );

The transformation itself is not populated with correct data,
so need to reach inside to get spacing, origin, etc.

From: Steve Pieper <pieper@bwh.harvard.edu>

Revision 23573  Directory Listing
Modified Sun Aug 17 23:30:09 2014 UTC (3 years, 1 month ago) by jcfr
ENH: Reduced the chance of crashes when CLI returns result images

From: Andras Lasso <lasso@queensu.ca>

Revision 23568  Directory Listing
Modified Fri Aug 15 18:41:40 2014 UTC (3 years, 1 month ago) by jcfr
BUG: Ensure slice intersection position are updated using VTK6. Fixes #3803

This commit fixes a regression introduced when transitioning to VTK6.

Note that ideally a pipeline should be created, that would avoid to
manually call Update or Modified.

Revision 23549  Directory Listing
Modified Mon Aug 4 18:31:05 2014 UTC (3 years, 1 month ago) by naucoin
BUG: fix force color to children checkbox in Models

When converting the model displayable manager to use
more scalar options, missed using the hierarchy display node
for cases when it over rides the model display node. Cast
the hierarchy display node to a model node and use it if defined.

Issue #3784

Revision 23531  Directory Listing
Modified Fri Aug 1 06:29:54 2014 UTC (3 years, 1 month ago) by jcfr
BUG: Fix IASEM extension tests ensuring ITKIOMRC factory is loaded

Revision 23524  Directory Listing
Modified Wed Jul 30 22:21:32 2014 UTC (3 years, 1 month ago) by finetjul
BUG: Propagate ModifiedEvent to volume/modelNode

When setting a raw (vs pipeline filter) input data to a mrml node,
the node was not notified (ProcessMRMLEvents) whenever the data
was changed because the trivial producer internally used
is not forwarding events.

Issue #3780

Revision 23523  Directory Listing
Modified Wed Jul 30 22:21:16 2014 UTC (3 years, 1 month ago) by finetjul
BUG: Set slice plane coordinates using plane source filter

Triggering ModifiedEvent on the input polydata does not (yet) propagate
onto the model node.
Closes #3780

Revision 23516  Directory Listing
Modified Wed Jul 30 16:13:41 2014 UTC (3 years, 1 month ago) by naucoin
BUG: fix typo in volume slice model attribute

Issue #3718

Revision 23495  Directory Listing
Modified Tue Jul 29 22:57:32 2014 UTC (3 years, 1 month ago) by naucoin
BUG: fix logic on showing slice intersections

Added an attribute (and a name) for the volume slice
model display nodes and check for it in a new slice
logic static method. If it's not a volume slice model
display node, use the visibility of the regular
model to determine if should show the slice intersections,
otherwise rely on the slice intersections visible flag.

Issue #3718

Revision 23490  Directory Listing
Modified Tue Jul 29 18:44:29 2014 UTC (3 years, 1 month ago) by jcfr
COMP: Add HDF5 and Matlab TransformIO to ITKFactoryRegistration

This commit explicitly lists these transform to ensure the associated
files can be read/write.

This should help in fixing error related to the integration of
BRAINSFit and EMSegment.

Co-authored-by: Bradley Lowekamp <blowekamp@mail.nih.gov>
Co-authored-by: Steve Pieper <pieper@isomics.com>

Revision 23470  Directory Listing
Modified Sun Jul 20 22:29:51 2014 UTC (3 years, 2 months ago) by alexy
BUG: Fixed crash on reading DWI volume in CLI modules, they assumed DWI had Tensors not Vectors which was wrong.

Revision 23461  Directory Listing
Modified Fri Jul 18 07:41:27 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Update CameraDisplayableManagerTest1 input scene to include MRML version

This commit updates the test input data to account for commit r23331
including MRML version in the mrml file.

Revision 23460  Directory Listing
Modified Fri Jul 18 07:41:24 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Fix memory initialization in vtkMRMLVolumeHeaderlessStorageNode

This commits fixes a problem discovered while running the test
vtkMRMLVolumeHeaderlessStorageNodeTest1 through valgrind.

[...]

==423== Conditional jump or move depends on uninitialised value(s)
==423==    at 0x53AB10F: vtkMRMLVolumeHeaderlessStorageNode::SetFileDimensions(int, int, int) (in /home/jchris/Projects/Slicer-2-SuperBuild-Debug/Slicer-build/bin/libMRMLCore.so)
==423==    by 0x53A762A: vtkMRMLVolumeHeaderlessStorageNode::vtkMRMLVolumeHeaderlessStorageNode() (vtkMRMLVolumeHeaderlessStorageNode.cxx:56)
==423==    by 0x53A7480: vtkMRMLVolumeHeaderlessStorageNode::New() (vtkMRMLVolumeHeaderlessStorageNode.cxx:39)
==423==    by 0x621EBF: vtkNew<vtkMRMLVolumeHeaderlessStorageNode>::vtkNew() (vtkNew.h:66)
==423==    by 0x61BC65: vtkMRMLVolumeHeaderlessStorageNodeTest1(int, char**) (vtkMRMLVolumeHeaderlessStorageNodeTest1.cxx:21)
==423==    by 0x4729AC: main (MRMLCoreCxxTests.cxx:616)

[...]

==423== Conditional jump or move depends on uninitialised value(s)
==423==    at 0x53AB10F: vtkMRMLVolumeHeaderlessStorageNode::SetFileDimensions(int, int, int) (in /home/jchris/Projects/Slicer-2-SuperBuild-Debug/Slicer-build/bin/libMRMLCore.so)
==423==    by 0x53A762A: vtkMRMLVolumeHeaderlessStorageNode::vtkMRMLVolumeHeaderlessStorageNode() (vtkMRMLVolumeHeaderlessStorageNode.cxx:56)
==423==    by 0x53A7480: vtkMRMLVolumeHeaderlessStorageNode::New() (vtkMRMLVolumeHeaderlessStorageNode.cxx:39)
==423==    by 0x53A7523: vtkMRMLVolumeHeaderlessStorageNode::CreateNodeInstance() (vtkMRMLVolumeHeaderlessStorageNode.cxx:39)
==423==    by 0x61BD63: vtkMRMLVolumeHeaderlessStorageNodeTest1(int, char**) (vtkMRMLVolumeHeaderlessStorageNodeTest1.cxx:25)
==423==    by 0x4729AC: main (MRMLCoreCxxTests.cxx:616)

[...]

Revision 23459  Directory Listing
Modified Fri Jul 18 07:41:22 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Fix memory initialization in vtkMRMLScalarVolumeNodeTest2

This commits fixes a problem discovered while running the test
 vtkMRMLScalarVolumeNodeTest2 through valgrind. It ensure the image
data is initialized with zeros.

[...]

==32668== Conditional jump or move depends on uninitialised value(s)
==32668==    at 0x1BC3DE03: void vtkImageAccumulateExecute<unsigned short>(vtkImageAccumulate*, vtkImageData*, unsigned short*, vtkImageData*, int*, double*, double*, double*, double*, long long*, int*) (vtkImageAccumulate.cxx:197)
==32668==    by 0x1BC34531: vtkImageAccumulate::RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkImageAccumulate.cxx:313)
==32668==    by 0x16C94CB7: vtkImageAlgorithm::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkImageAlgorithm.cxx:103)
==32668==    by 0x16C8A6AD: vtkExecutive::CallAlgorithm(vtkInformation*, int, vtkInformationVector**, vtkInformationVector*) (vtkExecutive.cxx:745)
==32668==    by 0x16C85002: vtkDemandDrivenPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkDemandDrivenPipeline.cxx:497)
==32668==    by 0x16C7E07E: vtkCompositeDataPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkCompositeDataPipeline.cxx:175)
==32668==    by 0x16C8476E: vtkDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkDemandDrivenPipeline.cxx:279)
==32668==    by 0x16CA9B25: vtkStreamingDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkStreamingDemandDrivenPipeline.cxx:346)
==32668==    by 0x16C801BA: vtkCompositeDataPipeline::ForwardUpstream(vtkInformation*) (vtkCompositeDataPipeline.cxx:712)
==32668==    by 0x16C846DD: vtkDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkDemandDrivenPipeline.cxx:265)
==32668==    by 0x16CA9B25: vtkStreamingDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) (vtkStreamingDemandDrivenPipeline.cxx:346)
==32668==    by 0x16C84E5B: vtkDemandDrivenPipeline::UpdateData(int) (vtkDemandDrivenPipeline.cxx:448)

[...]

Revision 23458  Directory Listing
Modified Fri Jul 18 07:41:20 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Fix memory initialization in vtkMRMLGlyphableVolumeDisplayNode

This commits fixes a problem discovered while running the test
vtkMRMLGlyphableVolumeDisplayNodeTest through valgrind. It ensures
that the ivar "VisualizationMode" is initialized.

[...]

==32528== Conditional jump or move depends on uninitialised value(s)
==32528==    at 0x23682EF0: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_int<long>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, long) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==32528==    by 0x236834BC: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, long) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==32528==    by 0x2368EFAD: std::ostream& std::ostream::_M_insert<long>(long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==32528==    by 0x53A4422: vtkMRMLGlyphableVolumeDisplayNode::PrintSelf(std::ostream&, vtkIndent) (vtkMRMLGlyphableVolumeDisplayNode.cxx:153)
==32528==    by 0x17BF4BD7: vtkObjectBase::Print(std::ostream&) (vtkObjectBase.cxx:149)
==32528==    by 0x508DBD: vtkMRMLGlyphableVolumeDisplayNodeTest1(int, char**) (vtkMRMLGlyphableVolumeDisplayNodeTest1.cxx:22)
==32528==    by 0x4729AC: main (MRMLCoreCxxTests.cxx:616)

[...]

Revision 23457  Directory Listing
Modified Fri Jul 18 07:41:16 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Fix memory initialization in vtkMRMLDiffusionWeightedVolumeNode

This commits fixes a problem discovered while running the test
vtkMRMLDiffusionWeightedVolumeNodeTest1 through valgrind. It
ensures that each time the number of gradient is set, the DiffusionGradients
and BValues double arrays are initialized with zeros. To do so,
a protected function "SetNumberOfGradientsInternal" is introduced, it is
doesn't invoke the modified event, set the double array value to zeros.

The redundant ivar "NumberOfGradients" has also been removed. Instead
the function "GetNumberOfGradients" return the number of tuples in
the DiffusionGradients array.

[...]

Conditional jump or move depends on uninitialised value(s)
==32492==    at 0x23B631D3: __printf_fp (printf_fp.c:404)
==32492==    by 0x23B62A9B: vfprintf (vfprintf.c:1654)
==32492==    by 0x23B875A4: vsnprintf (vsnprintf.c:119)
==32492==    by 0x2367E01F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==32492==    by 0x23684455: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_float<double>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, char, double) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==32492==    by 0x2368473F: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, double) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==32492==    by 0x2368FA34: std::ostream& std::ostream::_M_insert<double>(double) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==32492==    by 0x5143A38: vtkMRMLDiffusionWeightedVolumeNode::PrintSelf(std::ostream&, vtkIndent) (vtkMRMLDiffusionWeightedVolumeNode.cxx:394)
==32492==    by 0x17BF4BD7: vtkObjectBase::Print(std::ostream&) (vtkObjectBase.cxx:149)
==32492==    by 0x4B78B4: vtkMRMLDiffusionWeightedVolumeNodeTest1(int, char**) (vtkMRMLDiffusionWeightedVolumeNodeTest1.cxx:24)
==32492==    by 0x4729AC: main (MRMLCoreCxxTests.cxx:616)

[...]

Revision 23456  Directory Listing
Modified Fri Jul 18 07:41:14 2014 UTC (3 years, 2 months ago) by jcfr
ENH: MRMLIDImageIO - Invoke modified event at the end of gradient update

This commit reduce the number of modified event invoked by
vtkMRMLDiffusionWeightedVolumeNode by using StartModify/EndModify

Revision 23455  Directory Listing
Modified Fri Jul 18 07:41:12 2014 UTC (3 years, 2 months ago) by jcfr
STYLE: Update MRMLIDImageIO - Add comment line separator

Revision 23454  Directory Listing
Modified Fri Jul 18 07:41:09 2014 UTC (3 years, 2 months ago) by jcfr
ENH: Improve error checking in vtkMRMLDiffusionWeightedVolumeNode

This commit:

* updates function taking the number of gradient as input
parameter to also check if that number if negative.

* updates function taking a pointer to vtkMatrix4x4 and check for
null value.

* fixes indent.

Revision 23453  Directory Listing
Modified Fri Jul 18 04:45:59 2014 UTC (3 years, 2 months ago) by jcfr
COMP: Fix doxygen warnings and tweak doxygen layout

This commit also updated the main page to include an "important link"
section. It has been inspired by the Blender main page.

Revision 23448  Directory Listing
Modified Thu Jul 17 22:54:17 2014 UTC (3 years, 2 months ago) by jcfr
ENH: Update vtkMRMLColorTableNodeTest1 to test against expected output

This commit updates the test to check that color table entry
can be written and read from a color table file.

Some background into ...

Commit r20729 attempted to implement a test checking that the color table
entry could be written to a scene and read from the scene. The issue was
that the test was only displaying value and was not testing against
expected value.
Then, in commit r22344, the color mrml nodes have been updated to
to not write anymore into the mrml scene.

The test wasn't reporting that no color could be read but was still
passing, this commit updates the test and check for expected values instead
of just displaying them.

Revision 23447  Directory Listing
Modified Thu Jul 17 22:54:15 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Fix memory initialization in vtkMRMLColorTableNode::SetNumberOfColors

This commit fixes a problem discovered while running the test
vtkMRMLColorTableNodeTest1 through valgrind. It basically ensures that
new table entry are initialized.

==26783== Conditional jump or move depends on uninitialised value(s)
==26783==    at 0x23B631D3: __printf_fp (printf_fp.c:404)
==26783==    by 0x23B62A9B: vfprintf (vfprintf.c:1654)
==26783==    by 0x23B875A4: vsnprintf (vsnprintf.c:119)
==26783==    by 0x2367E01F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==26783==    by 0x23684455: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_float<double>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, char, double) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==26783==    by 0x2368473F: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, double) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==26783==    by 0x2368FA34: std::ostream& std::ostream::_M_insert<double>(double) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==26783==    by 0x511352D: vtkMRMLColorNode::SetNameFromColor(int) (vtkMRMLColorNode.cxx:312)
==26783==    by 0x511336F: vtkMRMLColorNode::SetNamesFromColors() (vtkMRMLColorNode.cxx:295)
==26783==    by 0x512245B: vtkMRMLColorTableNode::SetColor(int, char const*, double, double, double, double) (vtkMRMLColorTableNode.cxx:1301)
==26783==    by 0x48750A: vtkMRMLColorTableNodeTest1(int, char**) (vtkMRMLColorTableNodeTest1.cxx:83)
==26783==    by 0x47215C: main (MRMLCoreCxxTests.cxx:616)

Revision 23446  Directory Listing
Modified Thu Jul 17 22:54:13 2014 UTC (3 years, 2 months ago) by jcfr
ENH: Change vtkMRMLColorNode::GetColor to explicitly accept array of size 4

The function signature is now consistent with vtkLookupTable::GetTableValue.

Let's also note that when wrapped in python, an error will now be returned
if a list not having exactly a size of four is passed.

Revision 23445  Directory Listing
Modified Thu Jul 17 22:54:10 2014 UTC (3 years, 2 months ago) by jcfr
STYLE: Re-organize and simplify vtkMRMLColorTableNodeTest1

Revision 23444  Directory Listing
Modified Thu Jul 17 22:54:08 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Fix "Deleting Unknown Object" warning in all mrml node tests

This commits (1) changes the helper node class name associated with the
hierarchy node to be unique and (2) updates the helper node definitions
to be consistent with the helper node declared in vtkMRMLNodeTest1.

Also remove debug output for vtkMRMLColorNodeTest1 and vtkMRMLUnitNodeTest1.
The extra verbosity was adding "noise" to the test output.

Revision 23440  Directory Listing
Modified Wed Jul 16 04:20:01 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Fix valgrind issues in vtkMRMLVolumeNodeTest1

This commit fixes regression introduced by commit r19917. Instead
of re-implementing Get{I,J,K}ToRASDirection methods, the
macro "TEST_SET_GET_VECTOR3_DOUBLE_RANDOM" has been updated to directly
use the Set/Get method of the object. It then (1) avoids to return a
pointer and (2) avoids to access possibly uninitialized value with the
bracket operator.

Valgrind errors like this one are fixed:

[...]

==20657== Conditional jump or move depends on uninitialised value(s)
==20657==    at 0x626297: vtkMRMLVolumeNodeTest1(int, char**) (vtkMRMLVolumeNodeTest1.cxx:114)
==20657==    by 0x4717DC: main (MRMLCoreCxxTests.cxx:616)

[...]

Revision 23439  Directory Listing
Modified Wed Jul 16 04:19:58 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Fix "Deleting Unknown Object" warning in mrml node tests

This commits (1) changes the helper node class name associated with the
hierarchy node to be unique and (2) updates the helper node definitions
to be consistent with the helper node declared in vtkMRMLNodeTest1.

Revision 23438  Directory Listing
Modified Wed Jul 16 04:19:55 2014 UTC (3 years, 2 months ago) by jcfr
STYLE: Add vtkMRMLStorableNode method definition to cpp file.

Revision 23437  Directory Listing
Modified Wed Jul 16 04:19:53 2014 UTC (3 years, 2 months ago) by jcfr
STYLE: Add vtkMRMLDisplayableNode method definition to cpp file.

Revision 23436  Directory Listing
Modified Wed Jul 16 02:51:29 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Fix crash in vtkMRMLNode::UpdateNthNodeReference

This commit fixes regression introduced in previous commit r23435.
Interestingly the message in previous commit raised the question about
the assignment ReferencingNode. It turns out that the method
UpdateNthNodeReference was indirectly called after destroying the
referencing node.

The following pseudo stack trace illustrates the issue:

(obtained while running the test "vtkMRMLVolumeNodeTest1"

Destructor of vtkMRMLVolumeNode (referencing node)
-> SetImageDataConnection(0)
-> SetImageDataToDisplayNodes()
-> GetNthDisplayNode(n)
-> GetNthNodeReference()
-> UpdateNthNodeReference(referenceRole, n)
-> UpdateNthNodeReference(reference, n)
this->ReferencingNode = this

Since ReferencingNode is a weakpointer to the object represented by "this"
and was indirectly called in the destructor of "this", this was
causing a double free or corruption error. It was reported in valgrind
as a "invalid read of size 8".

The test is now passing. But valgrind is still reporting the error
like this one:

Generic Warning: In /home/jchris/Projects/Slicer-2-SuperBuild-Debug/VTKv6/Common/Core/vtkDebugLeaks.cxx, line 292
Deleting unknown object: vtkMRMLVolumeNodeTestHelper1

They will be fixed in follow-up commit.

Revision 23435  Directory Listing
Modified Tue Jul 15 21:56:02 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Fix infinite loop when opening or closing a scene

This commit fixes a regression introduced by commit r23191.

Commit r23191 simplified the code introducing smart pointer, typedefs and
also updated "SetNthNodeReferenceID" and "SetAndObserveNthNodeReferenceID"
so that they have have similar code. It turns out that after this update
new reference where systematically created with an ID being an empty string
instead of being a NULL string.

Commits following r23191 also updated the MRML reference system and
attempted to fix what was most likely an issue with the "SetNth" methods.
See r23192, r23196]. These commits fixes the behavior of the SetNth methods
so that setting a reference N was always returning the
associated reference if the reference n-1 was removed.

It turned out that these changes caused more trouble than expected and
to fully support the new behavior, major and backward incompatible changes
in the displayable and storable nodes and also in the scene serialization
would have occur. For that reason, commit r23395 and r23414 have been
integrated to revert all commit updating the behavior but keeping the
"smart pointer" and "typedefs" updates around.

It is only by "reverting" these last commit that the issue fixed by
this commit was revealed.

Note for later:

 * In method almost doing the same thing, do not comment code without
clearly mentioning the reason.

 * If very similar functions are doing almost the same thing, re-factoring
the code is key to reduce the maintenance burden.

Finally, this commit also update method "UpdateNthNodeReference"
to set the ReferencingNode (it was done before the commit introducing
smart pointers), the questions are "Why is this needed ?" and
"What is causing the reference to be dissociated from a referencing node?"

Fixes #3754
Fixes #3768

Revision 23432  Directory Listing
Modified Mon Jul 14 22:00:31 2014 UTC (3 years, 2 months ago) by jcfr
STYLE: Consistently use "referencedNodeID" parameter name

To make maintenance of the code easier, the same parameter name
is used across all MRML node reference functions.

Revision 23431  Directory Listing
Modified Mon Jul 14 21:32:32 2014 UTC (3 years, 2 months ago) by jcfr
ENH: Add test checking reference set to null or empty string are removed.

Revision 23428  Directory Listing
Modified Fri Jul 11 21:39:56 2014 UTC (3 years, 2 months ago) by lassoan
BUG: Fixed crash on scene close when the Transforms module is active

Units module triggered an update in the Transforms module GUI after the current transform node has been already deleted.
Use a weak pointer to make sure no dangling pointers are accidentally used.

Revision 23427  Directory Listing
Modified Fri Jul 11 21:34:09 2014 UTC (3 years, 2 months ago) by lassoan
BUG: Fixed saving of inverted linear transforms (conversion to ITK sense was missed for inverse transforms)

Revision 23415  Directory Listing
Modified Fri Jul 4 01:34:31 2014 UTC (3 years, 2 months ago) by jcfr
STYLE: Associate error message with MRML node attribute Get/Set/Remove func.

This commit removes the last assert from vtkMRMLNode implementation.

Revision 23414  Directory Listing
Modified Fri Jul 4 01:34:28 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Restore original behavior of vtkMRMLNode reference functions

This commit continues what has been started in r23395, it basically reverts
the logic handling reference to the implementation existing prior to r23192.

It reverts all the changes (r23192, r23196) that were done to be
able to set/get a reference at a position N. But it keeps:
 * the readability improvements to complete successfully. (r23193)
 * the transition to smart pointer simplifying the code (r23191)
 * changes done as part of r23192 and this commit fixing the
 following tests:
      - py_AtlasTests
      - py_CompareVolumes
      - py_SlicerMRBTest
      - py_RSNAVisTutorial
      - py_VolumeRenderingSceneClose
      - py_Slicer4Minute


It fixes "py_SubjectHierarchyGenericSelfTest" crash that is reported in
issue #3754 and was "related to MRML references. There are still one more
problem that is most likely related to the way SubjectHierarchySceneModel
deals with QModelIndex. See [1]

[1] https://www.assembla.com/spaces/slicerrt/tickets/598#/activity/ticket:

Revision 23413  Directory Listing
Modified Fri Jul 4 01:34:23 2014 UTC (3 years, 2 months ago) by jcfr
COMP: Move most of find_package calls into each Slicer sub-project.

To help address issue #3741 [1], call to find_package associated to CTK,
DCMTK, ITK and SlicerExecutionModel have been moved in every Slicer
sub project, library or module expecting it.

This allows to reduce both the number of include directories and
the number of libraries passed to the compiler.

Moving forward, every Slicer sub project, library or module will be
responsible to call find_package (optionally specifying a list of
components) and (if it applies) include the associated "use file".

Note that call to find_package(VTK) is still done at the top-level, before
moving the call to the expected sub-directories, the CTKConfig.cmake
will have to be updated to call find_package(VTK) specifying the required
components where it is needed.

[1] http://na-mic.org/Mantis/view.php?id=3741

Revision 23412  Directory Listing
Modified Fri Jul 4 01:33:36 2014 UTC (3 years, 2 months ago) by jcfr
COMP: Disable VTK find_package/use_file_include in sub directory.

Calling "find_package(VTK)/include(${VTK_USE_FILE})" in both the top-level
directory and sub-directories is undefined. Indeed, If we include
VTK_USE_FILE (UseVTK.cmake) in the top level then it is probably adding
the autoinit definitions to the COMPILE_DEFINITIONS directory property.
Then that inherits to the sub-directory and could conflict with any such
property defined there. Thanks to Brad King for his insight.

Revision 23411  Directory Listing
Modified Fri Jul 4 01:33:30 2014 UTC (3 years, 2 months ago) by jcfr
COMP: Shut-up CMake 3.0 warning for use of deprecated function by Teem

Waiting Teem gets ride of 'export_library_dependencies' and switches
to an export of targets, set policy CMP0033.

Revision 23407  Directory Listing
Modified Thu Jul 3 00:56:35 2014 UTC (3 years, 2 months ago) by lassoan
STYLE: Made vtkMRMLVolumeNode::SetAndObserveImageData description more accurate

Revision 23399  Directory Listing
Modified Mon Jun 30 21:18:30 2014 UTC (3 years, 2 months ago) by mwoehlke
ENH: Add function to list archives

Add a function to vtkArchive.cxx to obtain the list of files in an
archive without extracting the archive. Also, fix parameter name in
(misnamed) extract_tar to make at least some kind of sense.
("archiveFileName", as in list_archive(), would be better, since
extract_tar likewise works on non-tar archives, but for now leaving it
consistent with the function name.)

Revision 23397  Directory Listing
Modified Mon Jun 30 13:55:44 2014 UTC (3 years, 2 months ago) by jcfr
COMP: Fix test to work with restored "Set(AndObserve)NthNodeReference" funcs

This commit integrates the remaining of the test updates required for
commit r23395.

Revision 23395  Directory Listing
Modified Mon Jun 30 06:53:04 2014 UTC (3 years, 2 months ago) by jcfr
BUG: Restore original behavior of "Set(AndObserve)NthNodeReference" functions

This commit fixes test vtkSlicerUnitsLogicTest1 by partially reverting
commit r23192.

It restores the original behavior of the "Set(AndObserve)NthNodeReference"
functions. Instead of ensuring reference can be set and get at position
n, if n is larger than the number of reference nodes, the node ID
is added at the end of the list. If nodeReferenceID is 0, the node ID is
removed from the list.

Fixes #3708

Revision 23391  Directory Listing
Modified Fri Jun 27 21:33:27 2014 UTC (3 years, 2 months ago) by alexy
BUG: 3751. Fixed typo in the vtkMRMLModelNode::ApplyTransform code that broke hardening.

Revision 23387  Directory Listing
Modified Fri Jun 27 02:51:54 2014 UTC (3 years, 3 months ago) by jcfr
ENH: Added mouse cursor position to vtkMRMLCrosshairNode.

Now cursor (now only mouse position in 2D Slice view, but later also
other pointing devices can be supported) position can be obtained by
observing the vtkMRMLCrosshairNode singleton node.

The feature is used in:
* DataProbe window
* Transform info window (showing the transform displacement vector value
  at the current mouse position in real-time)

After the integration into the Slicer core is done, it will be also used
in MultiVolume, Multidimensional data for live 3D graphing.

Also separated SetCursorPositionRAS and SetCursorPositionXYZ methods to
allow 3D-only positioning devices to specify the cursor position
(when no 2D slice position is available)

From: Andras Lasso <lasso@queensu.ca>

Revision 23383  Directory Listing
Modified Thu Jun 26 17:09:35 2014 UTC (3 years, 3 months ago) by jcfr
ENH: Expose vtkMRMLSceneViewNode::GetNodesByClass to python

Since std::vector<vtkMRMLNode *> is not "wrapped" by PythonQt, this commit
add an alternative method returning the nodes as a vtkCollection.

From: Nicole Aucoin <nicole@bwh.harvard.edu>

Revision 23382  Directory Listing
Modified Thu Jun 26 16:02:12 2014 UTC (3 years, 3 months ago) by jcfr
STYLE: Elaborate doxygen documentation of qMMRLSCeneModel::nodeIndex

Revision 23381  Directory Listing
Modified Thu Jun 26 16:02:09 2014 UTC (3 years, 3 months ago) by jcfr
ENH: Expose qMRMLSceneModel mrml/setMRMLScene methods to python.

Revision 23380  Directory Listing
Modified Thu Jun 26 16:02:06 2014 UTC (3 years, 3 months ago) by jcfr
STYLE: Simplify qMRMLScene canBeAChild/canBeAParent implementation

Revision 23376  Directory Listing
Modified Thu Jun 26 06:24:30 2014 UTC (3 years, 3 months ago) by jcfr
COMP: Fix unused variable warning in vtkOrientedGridTransform

Revision 23375  Directory Listing
Modified Thu Jun 26 06:24:28 2014 UTC (3 years, 3 months ago) by jcfr
COMP: Fix sign-compare warning in vtkMRMLTransformStorageNode

Revision 23372  Directory Listing
Modified Thu Jun 26 03:28:52 2014 UTC (3 years, 3 months ago) by pinter
ENH: Temporary fix for contour slice intersections

Based on today's discussions, a type check has been added to model displayable manager to facilitate proper contour display until the new segmentation node object is created and a new displayable manager is added.

Revision 23370  Directory Listing
Modified Wed Jun 25 23:58:06 2014 UTC (3 years, 3 months ago) by pinter
BUG: Two fixes in vtkSlicerSubjectHierarchyModuleLogicTest

Still fails due to transform hardening issue (investigating)

Revision 23363  Directory Listing
Modified Mon Jun 23 15:35:17 2014 UTC (3 years, 3 months ago) by finetjul
BUG: Remove pipeline error in VTK6 with DiffusionTensorDisplayNode

Revision 23359  Directory Listing
Modified Sun Jun 22 16:31:49 2014 UTC (3 years, 3 months ago) by finetjul
BUG: Do not update scalar image pipeline if there is no input image

That would generate pipeline errors with the diffusion tensor display node.

Revision 23357  Directory Listing
Modified Sun Jun 22 06:38:33 2014 UTC (3 years, 3 months ago) by jcfr
COMP: Fix build error related to missing curl/curl.h

This commit fixes build error introduced by commit r23355 by moving the use
of "curl/curl.h" into the private implementation. That way, it won't be
required for user of the "vtkHTTPHandler" class to know about CURL, it
will be an implementation details.

Build error were occurring only windows because curl wasn't installed on the
system and the header wasn't found in default location.

Revision 23355  Directory Listing
Modified Sat Jun 21 16:20:03 2014 UTC (3 years, 3 months ago) by jcfr
COMP: Find LibArchive/CURL/OpenIGTLink/ZLIB package where required.

This commit complements commit r23350 and will help reducing the number
of parameters passed to the compiler/linker. See #3741

Revision 23349  Directory Listing
Modified Fri Jun 20 13:37:28 2014 UTC (3 years, 3 months ago) by finetjul
BUG: Fixes auto level for DTI images

* CalculateAutoLevel was not called in VTK 6 when the image was modified
* CalculateAutoLevel was aborting with Diffusion tensor display node
because the scalar image data did not have a Scalars array
* Also use GetDisplayScalarRange() in qSlicerScalarVolumeDisplayWidget

Revision 23348  Directory Listing
Modified Fri Jun 20 13:37:25 2014 UTC (3 years, 3 months ago) by finetjul
BUG: Fix vtkITKImageToImageFilter for VTK 6

The pipeline of filters was broken.

Fixes DiffusionWeightedVolumeMaskingTest

Revision 23347  Directory Listing
Modified Fri Jun 20 13:37:23 2014 UTC (3 years, 3 months ago) by finetjul
BUG: Fix vtkTeemEstimateDiffusionTensor

* The nrrd reader did not properly propagate the scalar type to the
pipeline on time.
* vtkTeemEstimateDiffusionTensor did not use a proper pipeline of filters
for the baseline and averagedwi outputs.

Fixes DWIToDTIEstimationTest and DiffusionTensorScalarMeasurementsTest

Revision 23346  Directory Listing
Modified Fri Jun 20 13:37:20 2014 UTC (3 years, 3 months ago) by finetjul
STYLE: Fix 80 char limit in vtkMRMLDiffusionTensorVolumeDisplayNode

Revision 23343  Directory Listing
Modified Wed Jun 18 15:02:14 2014 UTC (3 years, 3 months ago) by jcfr
COMP: Fix Slicer build warnings

This commit addresses two types of warnings:
 - unused variable warnings
 - RCC: Warning: No resources in '/path/to/foo.qrc

Revision 23331  Directory Listing
Modified Fri Jun 13 18:17:44 2014 UTC (3 years, 3 months ago) by alexy
BUG: 3231. Added MRML scene version check and warning on scene load.

Revision 23317  Directory Listing
Modified Mon Jun 9 17:02:01 2014 UTC (3 years, 3 months ago) by mwoehlke
COMP: Remove gratuitous virtual

Remove 'virtual' specifier of private classes in source files where said
classes are not and (due to being in a source file) never will be
derived. This avoids needing an explicit (virtual) dtor in order to
avoid a -Wnon-virtual-dtor warning.

Revision 23316  Directory Listing
Modified Mon Jun 9 17:02:00 2014 UTC (3 years, 3 months ago) by mwoehlke
COMP: Fix overloaded virtual warnings with VTKv6

Explicitly use base class implementations of transform overloads
operating on 'float' (which cast and call the double overloads, and so
will call the appropriate derived code) in order to avoid hiding the
overloads in the derived class. (Fixes -Woverloaded-virtual warnings.)

Revision 23313  Directory Listing
Modified Fri Jun 6 19:41:16 2014 UTC (3 years, 3 months ago) by jcfr
ENH: Add TestClearScene to vtkMRMLNodeTest1

This commit extends the test to check that the event invoked by
either a referencing or referenced node when clearing a scene are the expected
ones.

Issue #3708

Revision 23312  Directory Listing
Modified Fri Jun 6 19:41:14 2014 UTC (3 years, 3 months ago) by jcfr
ENH: Extend vtkMRMLNodeCallback API adding PrintSelf/GetReceivedEvents

This commit add the GetReceivedEvents and PrintSelf functions.
PrintSelf function displays the list of observed event that have been
invoked. This will be used in tests to display more information in case
the expected event count is different from the actual one.

Issue #3708

Revision 23309  Directory Listing
Modified Thu Jun 5 21:33:31 2014 UTC (3 years, 3 months ago) by jcfr
ENH: Simplify TestAddDelayedReferenceNode

This commit refactors the function "CheckNthNodeReferenceID"
to take an extra parameter named "expectedNodeReferenceID". This allows
the function to test the reference ID independently of the node reference
instance.

It also update the test to use convenience function where possible.

Issue #3708

Revision 23308  Directory Listing
Modified Thu Jun 5 21:33:29 2014 UTC (3 years, 3 months ago) by jcfr
ENH: Simplify TestAddRefrencedNodeIDWithNoScene

This commit extends "CheckNthNodeReferenceID()" function by introducing
the extra parameter named "referencingNodeAddedToScene" and refactor the
test to use it.

Issue #3708

Revision 23256  Directory Listing
Modified Wed May 28 22:04:19 2014 UTC (3 years, 3 months ago) by jcfr
BUG: Update CTK - Fix "No such slot" warning and optimize ctkVTKConnection

* Fixes #3361: Fix "No such slot" warning and optimize ctkVTKConnection

* Fixes #3719: py_SubjectHierarchyGenericSelfTest passes but it output warning about slot disconnection

* Improve performance of ctkVTKConnection creation/removal

* Add Qt5 support to CTK

* Thanks to Eric Larson. ctkAbstractView now provides a method allowing to
set multisampling.

* Since ctkErrorLogModel has been moved from CTKCore to CTKWidget (because
QStandardItemModel belongs to QtGUI), similarly the error log model has
been moved from qSlicerCoreApplication to qSlicerApplication.

Details:

$ git shortlog daaf705c..6f2c55809 --no-merges
Eric Larson (1):
      Added static method to set multisampling.

Jean-Christophe Fillion-Robin (18):
      Fix compilation of tests against VTK6
      Fix qDebug operator to handle case when VTKObject is null
      Improve documentation of setStrictTypeCheck() method
      Remove unused signal "isBroke()"
      Refactor ctkVTKConnectionTest1 for easier maintenance and readability
      Update ctkVTKConnectionTest1 to use ctkCallback
      Update ctkVTKConnectionTest1 to allow each test case to be run independently
      Split disconnect function
      Allow ctkVTKConnection pimpl to be subclassed
      Add method to return VTK object associated with ctkVTKConnection
      Add ctkVTKConnectionTestObjectDelete
      Fix ctkVTKConnectionTestObjectDelete
      Improve performance disabling "deletion" observation
      Fix ctkVTKConnectionTest1 removing connection time ratio test
      ENH: Pass Qt CMake variable using "mark_as_superbuild"
      Fixes configuration when enabling PythonQt wrapping
      Remove extra CMake debug statement introduced by commit 47b34216
      Update CTKWidget PythonQt decorator to fix build error following Qt5 transition

Julien Finet (1):
      Add support for Qt5

Matthew Woehlke (1):
      Allow compiling/installing generated Python files

Sascha Zelzer (8):
      First set of build system patches for Qt5 support.
      This commit enables Qt5 support for the CTK Core library, issue #277.
      Use Qt5 CMake 2.8.12 features.
      Qt5 compatibility for almost all libraries.
      Do not assume a specific Qt5 install structure.
      Make more libs and apps compatible with Qt5.
      Use Qt5 compatible qRestAPI version.
      Fix Qt5 dependencies in case only CTK_BUILD_ALL is enabled.

Revision 23249  Directory Listing
Modified Wed May 28 07:42:43 2014 UTC (3 years, 3 months ago) by jcfr
ENH: Simplify vtkMRMLTransformableNode::GetParentTransformNode

Revision 23246  Directory Listing
Modified Tue May 27 23:05:35 2014 UTC (3 years, 4 months ago) by jcfr
BUG: Added error reporting for scene file writing

The problem was that when the scene file (.mrml) saving
failed (e.g., because target was a read-only directory) then
no error was reported.

No error was reported for the sceneview thumbnail image
saving failure either.

From: Andras Lasso <lasso@queensu.ca>

Revision 23239  Directory Listing
Modified Tue May 27 21:44:45 2014 UTC (3 years, 4 months ago) by jcfr
ENH: vtkMRMLHierarchyNode methods made virtual

Two methods in vtkMRMLHierarchyNode made virtual. GetAssociatedChildrendNodes contained
a typo so it is now called GetAssociatedChildrenNodes. Subject hierarchy volumes plugin
now can add volumes from potential list to tree

From: Csaba Pinter <csaba.pinter@queensu.ca>

Revision 23236  Directory Listing
Modified Tue May 27 21:39:47 2014 UTC (3 years, 4 months ago) by jcfr
ENH: Node attribute table view and widget moved to MRMLWidgets

Now both Data and Subject hierarchy modules use qMRMLNodeAttributeTableView and
qMRMLNodeAttributeTableWidget, so they have been moved from Data module widgets to MRMLWidgets

From: Csaba Pinter <csaba.pinter@queensu.ca>

Revision 23228  Directory Listing
Modified Fri May 23 02:56:56 2014 UTC (3 years, 4 months ago) by jcfr
ENH: Expose qMRMLTreeView scene model and proxy model to python.

Revision 23224  Directory Listing
Modified Wed May 21 18:42:12 2014 UTC (3 years, 4 months ago) by finetjul
BUG: Update qMRMLSliderWidget single step when range changes

The single step can depend on the range of the slider, update it when
needed.

Issues #3657, #3700
$ git shortlog 3aaa591..daaf705 --no-merges
Julien Finet (1):
      Virtualize ctkRangeWidget and ctkSliderWidget public API

Revision 23223  Directory Listing
Modified Wed May 21 15:45:20 2014 UTC (3 years, 4 months ago) by pieper
BUG: #3694 check for valid image data before running pipeline

Since the display node is observing the image data directly it
may receive Modified events on image data that is not yet
completely constructed, in particular, during a DeepCopy, the scalar
fields may not yet have been copied when a ModifiedEvent is triggered
by one of the Set methods.

This change prevents a spurious vtkErrorMessage from being generated,
and so it allows the EMSegment test to pass.

Revision 23222  Directory Listing
Modified Wed May 21 15:38:38 2014 UTC (3 years, 4 months ago) by finetjul
BUG: Fix crash with vtkMRMLSelectionNode and vtkSlicerUnitsLogic

Since r23192, the GetUnitNodes() can return empty nodes.
This triggered asserts in vtkSlicerUnitsLogic.
vtkSlicerUnitLogic is only interested in unit quantities and IDs.

Revision 23218  Directory Listing
Modified Tue May 20 19:59:52 2014 UTC (3 years, 4 months ago) by jcfr
BUG: In Selection node, get unit node only for valid MRML node references.

This fixes the issue discussed in [1]

[1] http://slicer-devel.65872.n3.nabble.com/stack-trace-for-failing-self-test-tt4031667.html

Revision 23216  Directory Listing
Modified Tue May 20 18:06:58 2014 UTC (3 years, 4 months ago) by alexy
BUG: 3615. Enable Non-linear transforms in ModelSliceDisplayableManager

Revision 23208  Directory Listing
Modified Mon May 19 19:10:22 2014 UTC (3 years, 4 months ago) by finetjul
BUG: Automatically select the correct unit singlestep

Revision 23207  Directory Listing
Modified Mon May 19 19:10:14 2014 UTC (3 years, 4 months ago) by finetjul
ENH: Apply units to Transforms module

Revision 23205  Directory Listing
Modified Mon May 19 19:09:54 2014 UTC (3 years, 4 months ago) by finetjul
BUG: Remove qMRMLSliderWidget MinimumValue and MaximumValue by default

Closes #3661

Revision 23196  Directory Listing
Modified Mon May 19 15:54:21 2014 UTC (3 years, 4 months ago) by jcfr
BUG: Ensure any Nth reference can be set to 0

Revision 23193  Directory Listing
Modified Mon May 19 03:28:47 2014 UTC (3 years, 4 months ago) by jcfr
STYLE: Better readability of MRML node reference function

This basically improve the readabitliy of the code by changing:

  (*referencedNodesIt) -> reference
  references[n] -> reference

Revision 23192  Directory Listing
Modified Mon May 19 03:28:44 2014 UTC (3 years, 4 months ago) by jcfr
BUG: Fix behavior of "Set(AndObserve)NthNodeReference" function

This commit now ensures that if a reference is set to position N,
it can later be obtain given N.

The issue is illustrated below:

 SetNthNodeReferenceID("MyRole", /* n= */ 1, "ID2")
 GetNthNodeReferenceID("MyRole", /* n= */ 1)  => return NULL
 GetNthNodeReferenceID("MyRole", /* n= */ 0)  => return "ID2"

 => Getting reference N=1 should return ID2

For reference, the proposed change has also been discussed on the mailing
list. See [1]

[1] http://slicer-devel.65872.n3.nabble.com/MRML-References-update-proposal-tt4031425.html

Revision 23191  Directory Listing
Modified Mon May 19 03:28:41 2014 UTC (3 years, 4 months ago) by jcfr
ENH: Simplify MRMLReferences using smart pointers

* Use of smart pointer in vtkMRMLReference allows us to remove
the complicated code manually managing the calls to Register/UnRegister

* function "SetNthNodeReferenceID" and "SetAndObserveNthNodeReferenceID"
have been updated to have similar code (at the exception of the
code setting the observation events). The second will consist in factoring
code common code to avoid code duplication.

* SetNthNodeReferenceID/SetAndObserveNthNodeReferenceID have also
been fixed to work properly in case the reference doesn't exist
and referencedNodeID is null.

Revision 23190  Directory Listing
Modified Mon May 19 03:28:39 2014 UTC (3 years, 4 months ago) by jcfr
ENH: Re-factor and rename some of MRMLReference tests

This commit add convenience function allowing to systematically test
the different cases.

It also renames test functions to better represent the purpose of the
test:
  TestAddReferenceNodeID ->  TestSetAndObserveNodeReferenceID
  TestReferenceNodeNoObservers -> TestSetNodeReferenceID

Revision 23189  Directory Listing
Modified Mon May 19 03:28:36 2014 UTC (3 years, 4 months ago) by jcfr
STYLE: Remove unused Set/Get*Opacity method from slice logic

Following the introduction of the composite node (r175) that is able to
store the opacity information, these methods originally introduced
by r129 are now redundant and unused.

Revision 23188  Directory Listing
Modified Mon May 19 03:28:33 2014 UTC (3 years, 4 months ago) by jcfr
STYLE: Remove unused composite node "Grid" attribute

Revision 23187  Directory Listing
Modified Mon May 19 03:28:31 2014 UTC (3 years, 4 months ago) by jcfr
COMP: Fix unused variable in vtkMRMLNode::PrintSelf

Revision 23185  Directory Listing
Modified Fri May 16 21:11:28 2014 UTC (3 years, 4 months ago) by lassoan
ENH: Added support for oriented grid Transform

* Added a new class, vtkOrientedGridTransform, which is based on vtkGridTransform but orientation of the grid can be specified as well.
* Added test for vtkOrientedGridTransform to verify its derivative and inverse computation and equivalence with ITK displacement field transform.
* Simplified vtkMRMLGridTransform node: transform parameters are read/written into ITK transform file, no duplicate saving is done in the scene.
* Removed unused vtkITK files: itkDisplacementFieldTransform, itkEncodedTransformFileReader/Writer, as they were not used (and some of them even had the same name as existing ITK files).
* Support reading/writing of grid transform from/to nrrd, nhdr, mha, mhd, nii, nii.gz files

Resolves:
http://www.na-mic.org/Bug/view.php?id=3597
http://www.na-mic.org/Bug/view.php?id=3444
http://na-mic.org/Bug/view.php?id=2273

Partially resolves:
http://www.na-mic.org/Bug/view.php?id=3598

Revision 23177  Directory Listing
Modified Wed May 14 05:01:05 2014 UTC (3 years, 4 months ago) by jcfr
BUG: Fix for crash in vtkImageResliceMask (#3301)

* Force the output image and mask extent to be the same to avoid the possibility of mismatched extents
* Add a NULL-pointer check after the backgroundMaskPtr setting to prevent application crash (worst case it causes partial screen refresh)

From: Andras Lasso <lasso@queensu.ca>

Revision 23176  Directory Listing
Modified Wed May 14 05:01:02 2014 UTC (3 years, 4 months ago) by jcfr
COMP: Fix unused variable / unused typdefs warnings.

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 23175  Directory Listing
Modified Tue May 13 23:19:59 2014 UTC (3 years, 4 months ago) by jcfr
ENH: Simplify qMRMLUtils::qImageToVtkImageData using vtkQImageToImageSource.

Fixes #1263

From: Christopher Mullins <christopher.mullins@kitware.com>

Revision 23161  Directory Listing
Modified Tue May 13 16:23:49 2014 UTC (3 years, 4 months ago) by naucoin
COMP: remove unused variable warnings

Remove unused variables or mark as unused parameters
in the scene views module update.

Issue #1299


Revision 23160  Directory Listing
Modified Tue May 13 15:30:42 2014 UTC (3 years, 4 months ago) by naucoin
ENH: html facelift for SceneViews

Implemented a Qt web view and populated it with HTML to allow
viewing, editing, restoring, creating scene views with the
layout requested.

The scene view thumbnail is being written to disk in a temp dir.
To get the Edit, Delete, Restore and Capture funtionality I'm capturing the
clicks on the links and parsing specially formatted urls
(Edit/Restore/Delete mrmlNodeID/Create)

Clear out the temp files on scene close and clear the memory cache, now
don't have to write them out all the time. Resize the images before
writing to disk so that the web view doesn't have to handle resizing.
Added in support for VTK6
Created new MRML web view based on the qMRMLChartView.
It allows better resizing (returns an invalid size hint,
sets size policy to expanding/expanding) so that the web
view doesn't keep getting reset to width = 800.
Added a plug in for the designer.
Save and restore the scroll position so user goes back
to the scene view node that they were previously viewing after
adding a new scene view.

Running on a mac, you can't see the scroll bar
on the data store page nor on the scene views
module widget, but it is visible on a linux build.
You can scroll using the trackpad and it is consistent,
so only show the scroll bar as needed.
The dialog superclass disables capturing a new
thumbnail on review/edit so don't resave the thumbnail type nor the image data.

Issue #1299

Revision 23156  Directory Listing
Modified Tue May 13 05:07:19 2014 UTC (3 years, 4 months ago) by lassoan
COMP: Fixed linux warnings

Revision 23155  Directory Listing
Modified Tue May 13 04:35:28 2014 UTC (3 years, 4 months ago) by jcfr
COMP: Fix narrowing warnings in vtkMRMLTransformStorageNode

This commit fixes the following warnings:

/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx: In instantiation of ‘bool SetVTKBSplineFromITK(vtkObject*, vtkOrientedBSplineTransform*, itk::TransformBaseTemplate<double>::Pointer, itk::TransformBaseTemplate<double>::Pointer) [with T = double; itk::TransformBaseTemplate<double>::Pointer = itk::SmartPointer<itk::TransformBaseTemplate<double> >]’:
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:611:88:   required from here
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:316:108: warning: narrowing conversion of ‘(& transformFixedParamsItk)->itk::OptimizerParameters<double>::<anonymous>.itk::Array<double>::<anonymous>.vnl_vector<T>::operator[]<double>(0u)’ from ‘const double’ to ‘const int’ inside { } is ill-formed in C++11 [-Wnarrowing]
   const int gridSize[3]={transformFixedParamsItk[0], transformFixedParamsItk[1], transformFixedParamsItk[2]};
                                                                                                            ^
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:316:108: warning: narrowing conversion of ‘(& transformFixedParamsItk)->itk::OptimizerParameters<double>::<anonymous>.itk::Array<double>::<anonymous>.vnl_vector<T>::operator[]<double>(1u)’ from ‘const double’ to ‘const int’ inside { } is ill-formed in C++11 [-Wnarrowing]
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:316:108: warning: narrowing conversion of ‘(& transformFixedParamsItk)->itk::OptimizerParameters<double>::<anonymous>.itk::Array<double>::<anonymous>.vnl_vector<T>::operator[]<double>(2u)’ from ‘const double’ to ‘const int’ inside { } is ill-formed in C++11 [-Wnarrowing]
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:396:12: warning: unused variable ‘linear’ [-Wunused-variable]
     double linear[VTKDimension][VTKDimension] = { {1,0,0}, {0,1,0}, {0,0,1}};
            ^
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:397:12: warning: unused variable ‘offset’ [-Wunused-variable]
     double offset[VTKDimension] = {0,0,0};
            ^
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx: In instantiation of ‘bool SetVTKBSplineFromITK(vtkObject*, vtkOrientedBSplineTransform*, itk::TransformBaseTemplate<double>::Pointer, itk::TransformBaseTemplate<double>::Pointer) [with T = float; itk::TransformBaseTemplate<double>::Pointer = itk::SmartPointer<itk::TransformBaseTemplate<double> >]’:
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:612:88:   required from here
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:316:108: warning: narrowing conversion of ‘(& transformFixedParamsItk)->itk::OptimizerParameters<float>::<anonymous>.itk::Array<float>::<anonymous>.vnl_vector<T>::operator[]<float>(0u)’ from ‘const float’ to ‘const int’ inside { } is ill-formed in C++11 [-Wnarrowing]
   const int gridSize[3]={transformFixedParamsItk[0], transformFixedParamsItk[1], transformFixedParamsItk[2]};
                                                                                                            ^
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:316:108: warning: narrowing conversion of ‘(& transformFixedParamsItk)->itk::OptimizerParameters<float>::<anonymous>.itk::Array<float>::<anonymous>.vnl_vector<T>::operator[]<float>(1u)’ from ‘const float’ to ‘const int’ inside { } is ill-formed in C++11 [-Wnarrowing]
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:316:108: warning: narrowing conversion of ‘(& transformFixedParamsItk)->itk::OptimizerParameters<float>::<anonymous>.itk::Array<float>::<anonymous>.vnl_vector<T>::operator[]<float>(2u)’ from ‘const float’ to ‘const int’ inside { } is ill-formed in C++11 [-Wnarrowing]

Revision 23154  Directory Listing
Modified Tue May 13 04:32:12 2014 UTC (3 years, 4 months ago) by jcfr
COMP: Fix unused variable warnings in vtkMRMLTransformStorageNode

This commit fixes the following warnings:

/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:396:12: warning: unused variable ‘linear’ [-Wunused-variable]
     double linear[VTKDimension][VTKDimension] = { {1,0,0}, {0,1,0}, {0,0,1}};
            ^
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:397:12: warning: unused variable ‘offset’ [-Wunused-variable]
     double offset[VTKDimension] = {0,0,0};

Revision 23153  Directory Listing
Modified Tue May 13 04:28:31 2014 UTC (3 years, 4 months ago) by jcfr
COMP: Fix build error occurring with gcc >= 4.8

This commit fixes the following build error introduced by commit r23148:

/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx: In function ‘bool SetVTKBSplineFromITK(vtkObject*, vtkOrientedBSplineTransform*, itk::TransformBaseTemplate<double>::Pointer, itk::TransformBaseTemplate<double>::Pointer)’:
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:394:14: error: expected nested-name-specifier before ‘BulkTransformType’
     typename BulkTransformType* bulkItkAffine = dynamic_cast<BulkTransformType*> (bulkTransformItk.GetPointer());
              ^
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:394:14: error: expected ‘(’ before ‘BulkTransformType’
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:394:14: error: expected ‘;’ before ‘BulkTransformType’
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:395:14: error: expected nested-name-specifier before ‘IdentityBulkTransformType’
     typename IdentityBulkTransformType* bulkItkIdentity = dynamic_cast<IdentityBulkTransformType*> (bulkTransformItk.GetPointer());
              ^
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:395:14: error: expected ‘(’ before ‘IdentityBulkTransformType’
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:395:14: error: expected ‘;’ before ‘IdentityBulkTransformType’
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:398:9: error: ‘bulkItkAffine’ was not declared in this scope
     if (bulkItkAffine)
         ^
/path/to/Slicer/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx:414:14: error: ‘bulkItkIdentity’ was not declared in this scope
     else if (bulkItkIdentity)

Revision 23152  Directory Listing
Modified Tue May 13 03:52:15 2014 UTC (3 years, 4 months ago) by jcfr
COMP: Simplify MRML Scene API removing "Edited()" method. Fixes #3472

For sake of consistency, remove Edited method. Indeed, this was the only
event triggered using this approach and it was not observed. For reference,
this method was first introduced by commit r7727.

Revision 23151  Directory Listing
Modified Tue May 13 03:44:09 2014 UTC (3 years, 4 months ago) by lassoan
COMP: Fixed vtkOrientedBSplineTransform build with VTK6

Also added test for single-precision point transform computation in vtkOrientedBSplineTransform.

Revision 23149  Directory Listing
Modified Mon May 12 20:22:39 2014 UTC (3 years, 4 months ago) by lassoan
ENH: Added missing vtkOrientedBSplineTransform files

Revision 23148  Directory Listing
Modified Mon May 12 16:42:00 2014 UTC (3 years, 4 months ago) by lassoan
ENH: Replaced vtkITKBSplineTransform by vtkOrientedBSplineTransform

Problem:
vtkITKBSplineTransform incorrectly computed the 1. forward derivatives, 2. inverse displacement when there was a bulk transform component and rotated bspline grid, 3. the inverse displacement.

Analysis:
In the ITK bspline transform no inverse computation is available and in the current ITK bspline version no additive bulk transform is supported (therefore it is not backward-compatible with the old ITK bspline transform), ITK's transform support is very limited (compared to the powerful transform pipelines in VTK), and Slicer already uses VTK transforms (vtkGridTransform), therefore the ITK bspline is not usable in Slicer as is.
A bspline transform implementation is available in VTK, which is is efficient and well-tested (and equivalence with ITK's bspline implementation can be proven by testing).

Solution:
Replaced vtkITKBSplineTransform it with a vtkBSplineTransform-based transform, vtkOrientedBSplineTransform, which extends the original VTK class to handle arbitrarily oriented b-spline grids and supports an additive bulk transform.
Added test that verifies the vtkOrientedBSplineTransform's equivalence with the ITK BSpline transform implementation in the whole bspline grid (the differences are less than 1e-10).
Added test that verifies the correctness of the inverse and derivative computation.

Fixes:
http://www.na-mic.org/Bug/view.php?id=3664
http://www.na-mic.org/Bug/view.php?id=3659
http://www.na-mic.org/Bug/view.php?id=3614

Revision 23147  Directory Listing
Modified Fri May 9 19:18:37 2014 UTC (3 years, 4 months ago) by alexy
BUG: 3672. Made  Eigenvector to display for lines/tubes glyphs in vtkMRMLDiffusionTensorDisplayPropertiesNode to better map onto UI combo box index

Revision 23145  Directory Listing
Modified Fri May 9 13:16:35 2014 UTC (3 years, 4 months ago) by finetjul
STYLE: Use demand driven pipeline for VTKv6 in model DM

Issue #3514

Revision 23140  Directory Listing
Modified Thu May 8 07:58:19 2014 UTC (3 years, 4 months ago) by jcfr
COMP: Fix "unused-local"typedefs" warning and update ITKv4

Commit r23121 removed the addition of "-Wno-unused-local-typedefs",
this commit is an attempt to clean most of the warnings. It also
updates the ITKv4 external project so that it checks out the Slicer ITK
fork including the ITK patch currently in review. See [1], [2]

$ git shortlog 01661ccf99..184b1257ad
Jean-Christophe Fillion-Robin (3):
      COMP: Properly fix unused-local-typedefs warning using unused attribute.
      COMP: Fix "unused-local-typedefs" warnings
      COMP: Backport double conversion fix for "unused-local-typedefs" warning

[1] http://review.source.kitware.com/#/c/15379/
[2] http://review.source.kitware.com/#/c/15380/

Revision 23134  Directory Listing
Modified Tue May 6 22:23:45 2014 UTC (3 years, 4 months ago) by finetjul
COMP: Fix python wrapping on Windows

Attempt to fix the python wrapping on Windows machines.
Reduce the number of directories included for vtkWrapPython.

Revision 23133  Directory Listing
Modified Tue May 6 15:04:38 2014 UTC (3 years, 4 months ago) by finetjul
BUG: Fix crash when loading volume

Some compilers (e.g. i686-apple-darwin10-g++-4.2.1) fail when using RTTI
with vtkDataArrayTemplate.
VTKv6 offers the FastDownCast workaround by internally using static_cast.

Revision 23127  Directory Listing
Modified Mon May 5 19:26:47 2014 UTC (3 years, 4 months ago) by finetjul
BUG: Fix uninitialized pointer in vtkMRMLModelDisplayDisplayableManager

Revision 23125  Directory Listing
Modified Sun May 4 23:21:33 2014 UTC (3 years, 4 months ago) by finetjul
BUG: Fix crash in vtkMRMLModelDisplayableManager

Regression from r23118

Revision 23124  Directory Listing
Modified Sun May 4 15:01:01 2014 UTC (3 years, 4 months ago) by finetjul
BUG: Fix vtkMRMLDiffusionWeightedVolumeDisplayNode pipeline

Issue #3514

Revision 23122  Directory Listing
Modified Fri May 2 21:55:04 2014 UTC (3 years, 4 months ago) by finetjul
ENH: Add VTK 6 support 2/2

Issue #3514

Revision 23121  Directory Listing
Modified Fri May 2 21:49:48 2014 UTC (3 years, 4 months ago) by finetjul
ENH: Add VTK 6 support 1/2

1) Support vtk6 to build system.
http://www.vtk.org/Wiki/VTK/Build_System_Migration
Give users a build option between vtk5 and vtk6.
Solve vtk library python wrapping for VTK 6
Use system zlib (this is a hack)
Use system png (this is a hack)

2) Update dependency projects in superbuild including VTK, CTK, OpenIGTLinkIF, MultiVolumeExplorer.

3) Remove deprecated Macro.
The following two macros were deprecated in VTK 5.0 that were still supported, but have now been eliminated:
vtkTypeRevisionMacro has been replaced with vtkTypeMacro; vtkCxxRevisionMacro has been removed.
http://www.visitusers.org/index.php?title=VTK_6.0_Upgrade

The following two macros were deprecated in VTK 6.0 if VTK_LEGACY_REMOVE is on:
VTK_LARGE_INTEGER and VTK_LARGE_FLOAT
https://github.com/Kitware/VTK/blob/9a0fbb8da1a1701dc1b44c71467b969b3302efad/Common/Core/vtkType.h#L158-159

vtkFloatingPointType is replaced with double.
http://review.source.kitware.com/#/t/1667/

vtkType deprecations
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/vtkType_deprecations

4) Replace SetInput() with SetInputData() and SetInputConnection(), the same kind of functions include SetInput1(), SetInput2(), AddInput() and SetSource().
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Replacement_of_SetInput

5) Remove GetProducerPort() from vtkDataObject.
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_GetProducerPort

6) Remove Execute
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_Execute

7) Remove SetWholeExtent() from vtkDataObject
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_SetWholeExtent

8) Remove Methods for Manipulating Update Extent
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_Methods_for_Manipulating_Update_Extent

9) Change AllocateOutputData() in vtkImageAlgorithm.
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Change_to_AllocateOutputData

10) Remove CopyInformation and CopyTypeSpecificInformation from vtkDataObject and vtkImageData.
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_CopyInformation

11) Remove GetPipelineInformation and GetExecutive from vtkDataObject.
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_GetPipelineInformation

12) VTK6 requires #include <vtkVersion.h> to use the VTK_xxx_VERSION preprocessor directives.
http://vtk.org/Wiki/VTK/VTK6/Migration/WikiExamples#Improve

13) Remove Methods for Manipulating Update Extent.
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_Methods_for_Manipulating_Update_Extent.
http://vtk.org/Wiki/VTK/VTK6/Migration/WikiExamples#Improve.

14) Change scalars manipulation functions
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Changes_to_Scalars_Manipulation_Functions.
http://vtk.org/Wiki/VTK/VTK6/Migration/WikiExamples#Improve.

15) Remove Pipeline Update Methods from vtkDataObject.
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_Update

16) Remove Pipeline Update Methods from vtkDataObject.
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_Update.

17) Refactor functions in vtkMRMLModelNode and sublcasses.

18) Refactor functions in vtkMRMLVolumeNode and its subclasses.
Use ImageDataPort instead of ImageData

Issue #3514

From Yuzheng Zhou <yuzheng.zhou@kitware.com>

Revision 23120  Directory Listing
Modified Fri May 2 21:49:01 2014 UTC (3 years, 4 months ago) by finetjul
BUG: Fix VTK 4 backward compatibility removal

Issue #3485

Revision 23119  Directory Listing
Modified Fri May 2 21:48:56 2014 UTC (3 years, 4 months ago) by finetjul
ENH: Remove VTK 4 backwards compatibility

Removed vtkSource, vtkProcessObject and subclasses.
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Overview#Removal_of_VTK_4_Backwards_Compatibility_Superclasses
http://www.vtk.org/Wiki/VTK/Tutorials/New_Pipeline#Converting_an_Existing_Filter_to_the_New_Pipeline

Closes #3485
From Yuzheng Zhou <yuzheng.zhou@kitware.com>

Revision 23118  Directory Listing
Modified Fri May 2 21:10:43 2014 UTC (3 years, 4 months ago) by naucoin
BUG: fix fiber bundle color display

Check for fiber bundle display nodes and use the old method,
igoring the new scalar range options for models. Fixes bug
introduced with issue #3573 in svn revision 23083

Issue #3672

Revision 23110  Directory Listing
Modified Tue Apr 22 17:29:35 2014 UTC (3 years, 5 months ago) by lassoan
STYLE: Added comments describing the grid transform reader behavior

Revision 23105  Directory Listing
Modified Thu Apr 17 16:39:37 2014 UTC (3 years, 5 months ago) by lassoan
COMP: Fixed linux build warnings

Revision 23102  Directory Listing
Modified Wed Apr 16 17:40:24 2014 UTC (3 years, 5 months ago) by lassoan
ENH: Added visualization of transforms

New features:
* Support non-linear transforms in the Transforms module: allow Apply, Harden, Invert transform
* Transform information displayed in the Transforms module (type of transform, basic properties)
* Transform visualization:
** Built into the Transforms module
** Three main modes: Glyphs (show an array of arrows, cones, spheres), Grid (show a deformed grid), or Contour (show isolines/isosurfaces for specified displacement magnitude values)
** All transform types are supported (chains of transforms as well)
** Visualization in the slice viewers
** Visualization in the 3D viewers, in the specified region (region can be a slice viewer, a volume, or a ROI widget)
** Real-time update: if the transform (or any visualization parameter) is changed then the visualization is updated immediately (interactive visualization while editing the transform)
** Built-in colormap editor
* MetaImage (mha), NIFTI (nii) vector volumes can be loaded as displacement field (grid) transform

Revision 23099  Directory Listing
Modified Wed Apr 16 07:58:11 2014 UTC (3 years, 5 months ago) by jcfr
BUG: Fix CMake 3.x configuration warnings

Test done using CMake 3.0.20140413 (g94d5a)

Since project version is explicitly set, avoid warning by setting
policy CMP0048

Since ITKConfig.cmake append value to "ITK_LIBRARIES" and "ITK_INCLUDE_DIRS"
variables, let's make sure that "ITKFactoryRegistration" is not in the list
when configuring "ITKFactoryRegistration". This fixes the following
warnings:

//--------------
CMake Warning (dev) at Libs/ITKFactoryRegistration/CMakeLists.txt:55 (add_library):
  Policy CMP0038 is not set: Targets may not link directly to themselves.
  Run "cmake --help-policy CMP0038" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Target "ITKFactoryRegistration" links to itself.
This warning is for project developers.  Use -Wno-dev to suppress it.
//--------------

Revision 23098  Directory Listing
Modified Mon Apr 14 21:11:00 2014 UTC (3 years, 5 months ago) by naucoin
ENH: add view node combo box for models

Gives users a GUI element to set models visible in selected
views. 
Updated the displayable manager so that the model slice intersection
honors the overall display node visibility setting.

Issue #3216


Revision 23095  Directory Listing
Modified Mon Apr 14 02:14:12 2014 UTC (3 years, 5 months ago) by naucoin
COMP: revert windows compilation change

A fix was already checked in


Revision 23094  Directory Listing
Modified Mon Apr 14 02:09:53 2014 UTC (3 years, 5 months ago) by naucoin
COMP: memory allocation on windows

Issue #3573


Revision 23093  Directory Listing
Modified Sat Apr 12 16:37:25 2014 UTC (3 years, 5 months ago) by lassoan
COMP: Fixed Windows build error

Revision 23091  Directory Listing
Modified Sat Apr 12 06:11:22 2014 UTC (3 years, 5 months ago) by jcfr
COMP: Fix sign compararison warnings

Revision 23086  Directory Listing
Modified Fri Apr 11 22:06:19 2014 UTC (3 years, 5 months ago) by naucoin
ENH: expand the view combo box to work on abstract view nodes

Removed the limitation on the display node view combo box that
only allowed selecting 3D view nodes, now all subclasses of
abstract view nodes can be used. Slice nodes and chart view
nodes are now allowed. This fixes the issue that while a
display node could have a slice node added to it's list of
view nodes, this combo box would remove it as it wasn't a
3d view node.
Update the volume rendering module widget to use the new combo
box code, limiting the view nodes to 3d ones since volume
rendering can't be shown in slice views.

Issue #3216


Revision 23085  Directory Listing
Modified Fri Apr 11 22:03:32 2014 UTC (3 years, 5 months ago) by naucoin
BUG: unify how add/remove handle error cases

Remove the error print out when removing a view node that
is not in the list, since when adding a view node that is
already in the list no error is printed. The code recovers
gracefully, no need to post an error.

Issue #3216


Revision 23084  Directory Listing
Modified Fri Apr 11 21:51:08 2014 UTC (3 years, 5 months ago) by naucoin
ENH: Add procedural color storage node and GUI support

Add a new storage node, register it, test it.
Added support for copying procedural nodes so that users can copy
an existing one and then save it to disk.
LoadColorFile expanded to work with both color table and procedural
color node loading.
TBD: add support for .cxml
Added support in the Colors gui to display and edit color transfer
functions (Continuous frame, with a ctkVTKScalarsToColorsWidget).
As well as allowing the scalar bar widget to be set from a procedural
color node.

Issue #3573


Revision 23083  Directory Listing
Modified Fri Apr 11 21:44:58 2014 UTC (3 years, 5 months ago) by naucoin
ENH: Expand scalar range options

Add the ScalarRangeFlag on the display node, test it, use it in the Model
display node.
Provide a GUI interface for it in the Models Scalars GUI.
Use it in the model displayable manager.
Separate out the auto scalar range setting from updating the poly data
in the model display node.

This expands the options from just using the scalar range of the data
to allowing the user to select using the scalar range defined on the
display node, the range on the color node, or the range of the data
type (use this last with caution, TBD: readjusting the minimum and
maximum values allowed on the range slider). Keeps the default
behaviour of AutoScalarRange and Data. The interaction of Auto/Manual
and the range flags might need some tweaking.
Also keeps the deep copy of the color look up table in the model displayable
manager - monitor for performance issues.
Expands the model displayable manager to work with procedural color nodes,
this required copying the color transfer function to a look up table to
support setting the range. Using a table with 256 entries for now.
UI full change due to having to run dos2unix on it to get it commited
to git without whitespace errors.

Issue #3573


Revision 23082  Directory Listing
Modified Fri Apr 11 21:41:05 2014 UTC (3 years, 5 months ago) by naucoin
ENH: move the User and File node types up to superclass
Support for user and file procedural color nodes requires that these
node types be moved into the color node superclass, not just defined
on the color table node.

Issue: 3573


Revision 23080  Directory Listing
Modified Fri Apr 11 18:12:49 2014 UTC (3 years, 5 months ago) by alexy
BUG: 3618. Changed interpolation mode to linear in the vtkMRMLVolumeNode::ApplyNonLinearTransform()

Revision 23079  Directory Listing
Modified Fri Apr 11 16:22:11 2014 UTC (3 years, 5 months ago) by lassoan
ENH: Allow loading of bspline transforms with IdentityTransform bulk component

Revision 23077  Directory Listing
Modified Fri Apr 11 04:10:41 2014 UTC (3 years, 5 months ago) by jcfr
ENH: Remove ITKv3 support

As discussed on the mailing list [1] and reported on the Roadmap [2],
this commit removes all conditional code that was allowing Slicer4 to be
compiled against ITKv3.

Code that was building only against ITKv3 has also been removed. This
includes DicomToNrrdConverter CLI module
and SlicerITKv3N4MRIBiasFieldCorrectionImageFilter class.

[1] http://slicer-devel.65872.n3.nabble.com/Removal-of-ITKv3-support-tt4031364.html

[2] http://wiki.slicer.org/slicerWiki/index.php/Roadmap#Deprecation_.2F_API_Changes

Revision 23062  Directory Listing
Modified Wed Apr 9 06:58:19 2014 UTC (3 years, 5 months ago) by jcfr
COMP: Fix build error introduced in commit r23061

Revision 23061  Directory Listing
Modified Wed Apr 9 06:25:58 2014 UTC (3 years, 5 months ago) by jcfr
ENH: Add support for scripted module available as ".pyc" file

Revision 23058  Directory Listing
Modified Tue Apr 8 17:41:15 2014 UTC (3 years, 5 months ago) by jcfr
ENH: Associate a component with install rules

Revision 23046  Directory Listing
Modified Fri Apr 4 19:21:17 2014 UTC (3 years, 5 months ago) by finetjul
BUG: Separator appears in MRML node combobox menu with custom items only

The MRML node combobox can have extra items on the top or bottom of the node list. There are built-in extra items, such as None, Add, etc. When these are enabled, then a separator appears between the nodes and the items. However, when no built-in extra item is enabled, just custom extra items are added, then the separator did not show up.

From: Csaba Pinter <csaba.pinter@queensu.ca>

Revision 23034  Directory Listing
Modified Tue Apr 1 19:15:04 2014 UTC (3 years, 5 months ago) by pieper
BUG: check validity of node before operating on it

Fixes a crash during scene shutdown.

Revision 23028  Directory Listing
Modified Thu Mar 27 18:44:07 2014 UTC (3 years, 6 months ago) by finetjul
BUG: Accept qMRMLSceneModel::updateNodeItems with node with no scene

To have no scene in qMRMLSceneModel::updateNodeItems()) is a valid case.
When closing the scene, the "Close" state is popped and SceneClosedEvent
event is triggered, caught by an observer that eventually modify a
node, such modification is caught by a scene model that has not yet
received teh SceneClosed event. It asks if the scene is closing but it
is no longer (see vtkMRMLScene::EndState())

Closes #3513

Revision 23022  Directory Listing
Modified Wed Mar 26 17:45:44 2014 UTC (3 years, 6 months ago) by hjohnson
STYLE: Githook warnings about excessive line length

pre-commit hook failure
-----------------------
  in file 'Libs/MRML/Logic/vtkImageLinearReslice.cxx' is longer than 160 characters.
  in file 'Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationControlPointsNode.cxx' is longer than 160 characters.
  in file 'Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationControlPointsStorageNode.cxx' is longer than 160 characters.
  in file 'Modules/Loadable/Annotations/Testing/Cxx/vtkMRMLAnnotationControlPointsNodeTest1.cxx' is longer than 160 characters.

Revision 23021  Directory Listing
Modified Wed Mar 26 17:45:15 2014 UTC (3 years, 6 months ago) by hjohnson
STYLE: Remove end of line spaces

Spaces at the end of lines can cause noise in patch sets
when editors or git gobbles them up during other relatively
minor changes to files.

Removing end of line changes makes long term maintenance easier as
well.

When reviewing git histories or patch sets, the "--ignore-space-change"
option can be useful in filtering out changes due only to spacing.

i.e.
git diff HEAD~2 --ignore-space-change

Revision 23020  Directory Listing
Modified Wed Mar 26 15:46:42 2014 UTC (3 years, 6 months ago) by hjohnson
COMP: Error due to imporoper linkage specification

inline functions are required to be declared and defined
in the same scope.  The inline specifier changed the linkage
signature an prevented this from compiling.

Undefined symbols for architecture x86_64:
  "vtkMRMLSliceNode::GetNumberOfThreeDViewIDs() const", referenced from:
      PyvtkMRMLSliceNode_GetNumberOfThreeDViewIDs(_object*, _object*) in vtkMRMLSliceNodePython.cxx.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Revision 23019  Directory Listing
Modified Mon Mar 24 22:12:24 2014 UTC (3 years, 6 months ago) by finetjul
ENH: Don't read headers for 2D files

+ Shortcut the costly vtkMRMLStorageNode::AddFileName()

Revision 23018  Directory Listing
Modified Mon Mar 24 22:12:16 2014 UTC (3 years, 6 months ago) by finetjul
ENH: Cleanup and speedup vtkMRMLScene::IsFilePathRelative and

SystemTools::SplitPath() was unnecessary slow to know if a path is relative
or absolute.

Revision 23017  Directory Listing
Modified Mon Mar 24 22:12:10 2014 UTC (3 years, 6 months ago) by finetjul
ENH: Add vtkMRMLCameraNode::SetViewAngle

Revision 23016  Directory Listing
Modified Mon Mar 24 22:12:04 2014 UTC (3 years, 6 months ago) by finetjul
ENH: Add vtkMRMLLayoutLogic::MaximizeView()

Revision 23015  Directory Listing
Modified Mon Mar 24 22:11:58 2014 UTC (3 years, 6 months ago) by finetjul
ENH: Factorize slice composite node search in vtkMRMLSliceLogic

Revision 23012  Directory Listing
Modified Mon Mar 24 22:11:39 2014 UTC (3 years, 6 months ago) by finetjul
STYLE: Add accessors to vtkMRMLCameraNode

Revision 23011  Directory Listing
Modified Mon Mar 24 22:11:32 2014 UTC (3 years, 6 months ago) by finetjul
ENH: Propagate vtkMRMLSliceNode::ThreeDViewIDs to slice model display

Revision 23010  Directory Listing
Modified Mon Mar 24 22:11:24 2014 UTC (3 years, 6 months ago) by finetjul
ENH: Add ThreeDViewIDs property to slice node

This does basically what the property ViewNodeIds does for the display
nodes, it allows the user to choose in which view a slice node can or
cannot be displayed.

Revision 23008  Directory Listing
Modified Wed Mar 19 17:41:09 2014 UTC (3 years, 6 months ago) by lassoan
ENH: Several fixes and improvements in transform handling

Major fixes:
* Added mechanism to prevent immediate invocation of TransformModified events (similarly to Modified events) to allow atomic changes of transforms and prevent multiple event invocations (fixes #3610, #3611).
* Fixed vtkITKBSplineTransform inverse computation (the bulk component was ignored in the inverse computation due to a shadow variable)
* Fixed DeepCopy of vtkITKBSplineTransform.cxx (InternalDeepCopy method had to be implemented)
* Use vtkTransform's ability to compute inverse transforms instead of keeping separate transforms for forward and inverse transforms (still kept the two member variables in the transform node base class to allow storing of forward and inverse transform if they are both computed, e.g., some Demons registration provides both the forward and inverse transforms as outputs).
* Fixed ReadWriteAsTransformToParent logic in the storage node class (as inverse warp transforms usually cannot be written, the flag should point to the forward transform class). For convenience, the flag is updated automatically when a To/FromParentTransform is set in the transform node.
* Fixed transform node copy: now a true deep copy is performed (earlier only the pointer of the transforms were copied, therefore changing a transform in a node changed the copied node, too)
* Removed vtkMRMLNonlinearTransformNode, as non-linear transforms are not special cases anymore: the base transform class can manage them the same way as linear transforms.
* Changed Get/SetMatrixTransformToParent and Get/SetMatrixTransformFromParent method to make it clear that it makes a copy of the input and output, so changing a matrix is only possible by using the Set... method (and not Get...()->DeepCopy(...)). Kept the old functions to prevent build errors, but they are deprecated and a warning is logged if they are used (as the behavior of the Get... function is changed from a shallow copy to a deep copy). This API change required changing of a lot of file in the Slicer core and extensions.

Minor fixes:
* Made vtkMRMLTransformNode non-abstract: this is the class that can handle arbitrarily complex composite transforms (e.g., grid transform hardened on a bspline transform).
* Fixed invalid NonLinearTransformScene.mrml scene: wrong storage node ref ID caused warnings in the tests
* Changed the Bspline-f-m.tfm test data to include larger bulk component to make errors more detectable
* Added tests for composite transforms (e.g., hardened combination of grid and bspline transform)
* Split the transform node's huge read/write methods to separate smaller methods (one for each transform type)
* Added the option of loading a .mha file as a grid transform

Extensions updated according to the API change: OpenIGTLinkIF, SlicerIGT, SlicerRT, and TransformVisualizer. See details at:
https://github.com/openigtlink/OpenIGTLinkIF/pull/25
https://github.com/SlicerIGT/FiducialRegistrationWizard/pull/14
https://github.com/SlicerIGT/BreachWarning/pull/1
https://github.com/SlicerIGT/PivotCalibration/pull/13
https://github.com/SlicerIGT/TransformFusion/pull/2
https://www.assembla.com/spaces/slicerrt/tickets/563

Tests performed:

* All automatic tests passed (except those that are known to fail in the nightly builds)

* Load MRBrainTumor1 & MRBrainTumor2 sample
* Create model of MRBrainTumor2, threshold=50
* Linear registration with BRAINS (fixed: MRBrainTumor1 & moving: MRBrainTumor2)
* VERIFY: the resampled output image should look the same as the dynamically transformed moving volume, checked on several slices
* Save the transform as tfm from file, load the transform from file, apply the transform to the moving image
* VERIFY: the resampled output image should look the same as the dynamically transformed moving volume
* Apply transform to the model
* VERIFY: model is deformed in the 3D view, aligned with the volume slices
* Harden transform to the model
* VERIFY: model in the 3D view doesn’t change, model slice intersections are aligned with the volume
* Harden the transform on the volume
* VERIFY: the image doesn’t change too much

* BSpline registration with BRAINS (fixed: MRBrainTumor1 & moving: MRBrainTumor2)
* VERIFY: the resampled output image should look the same as the dynamically transformed moving volume
* Save the transform as tfm from file, load the transform from file, apply the transform to the moving image
* VERIFY: the resampled output image should look the same as the dynamically transformed moving volume
* Apply transform to the model
* VERIFY: model is deformed in the 3D view, aligned with the volume slices
* Harden transform to the model
* VERIFY: model in the 3D view doesn’t change, model slice intersections are aligned with the volume
* Insert linear transform between bspline and volume, move sliders
* VERIFY: volume deforms as it travels through the BSpline region
* Harden the transform on the volume
* VERIFY: the image doesn’t change too much

* Create a two markup list (each having 15 points), all but 3 in the same position
* Landwarp registration with Plastimatch with the markup lists, save the displacement field to file
* Load the displacement field
* VERIFY: the resampled output image should look the same as the dynamically transformed moving volume
* Apply the displacement field to the moving fiducials
* VERIFY: all the fiducials are now in the same position
* Harden the transform on the fiducials
* VERIFY: the fiducials don’t move
* Apply transform to the model
* VERIFY: model is deformed in the 3D view, aligned with the volume slices
* Harden transform to the model
* VERIFY: model in the 3D view doesn’t change, model slice intersections are aligned with the volume
* Harden the transform on the volume
* VERIFY: the image doesn’t change too much

* Load MRI head, create new linear transform, apply to the volume, move the sliders
* VERIFY: the volume moves in the slice viewer, the numbers change in the matrix
* Click Invert, Identity
* VERIFY: volume jumps to other side, to the center
* Connect to an OpenIGTLink server, apply a transform to a volume
* VERIFY: transform matrix values updated in transforms module, volume moves

Revision 22942  Directory Listing
Modified Tue Mar 11 14:33:48 2014 UTC (3 years, 6 months ago) by pieper
BUG: #3429 bounds check on biomdal analysis

Revision 22937  Directory Listing
Modified Mon Mar 10 22:27:24 2014 UTC (3 years, 6 months ago) by naucoin
ENH: default value of HideFromEditors flag set to 0

This change will cause new mrml nodes to not be hidden
from editors by default, developers subclassing
vtkMRMLNode will need to specify the following in
constructors to over ride this behaviour:
this->HideFromEditors = 1;

MRML Core nodes that should be hidden in the Data module
were updated to stay hidden.

From the Slicer Roadmap for 4.4:
https://www.slicer.org/slicerWiki/index.php/Roadmap#4.4

Issue #2906


Revision 22929  Directory Listing
Modified Fri Mar 7 17:57:38 2014 UTC (3 years, 6 months ago) by naucoin
ENH: save the last sceneview thumbnail type

Keep track of the last scene view and screen snapshot thumbnail type
and use it for the next one that's being captured.
For the scene views, base the next scene view name on the last
one instead of always going back to the default SceneView.

Issue #1760

Revision 22924  Directory Listing
Modified Wed Mar 5 23:44:07 2014 UTC (3 years, 6 months ago) by jcfr
STYLE: Define and use Superclass typedef in qMRMLItemDelegate

Revision 22914  Directory Listing
Modified Mon Mar 3 00:08:31 2014 UTC (3 years, 6 months ago) by jcfr
COMP: C++11 compiler warning convert NULL to bool

warning: implicit conversion of NULL constant to 'bool' [-Wnull-conversion]

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 22913  Directory Listing
Modified Mon Mar 3 00:08:28 2014 UTC (3 years, 6 months ago) by jcfr
COMP: C++11 conformance for static initialization

error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'IndexValueType' (aka 'long') in initializer list [-Wc++11-narrowing]
as identifiied by the clang compiler.

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 22912  Directory Listing
Modified Thu Feb 27 23:43:52 2014 UTC (3 years, 6 months ago) by naucoin
BUG: reset table range for label map volumes

Label map volumes need to be mapped to colors in the color
look up table. For editing, don't allow procedurally defined
color nodes to be chosen.

Issue #3586


Revision 22910  Directory Listing
Modified Thu Feb 27 14:19:13 2014 UTC (3 years, 6 months ago) by jcfr
ENH: Associated hierarchy node with ChildNode(Added/Removed)Event

It will now be easier to know which node has been added or removed
from a given hierarchy.

Still need to figure out which node to associated with the event
'ChildNodeRemovedEvent' invoked in function 'vtkMRMLHierarchyNode::RemoveHierarchyChildrenNodes'

Revision 22900  Directory Listing
Modified Tue Feb 25 16:43:23 2014 UTC (3 years, 7 months ago) by jcfr
BUG: fixed improper importing a series of dicom images.

Fixes #3386

From: Kevin Wang <kevin.wang@rmp.uhn.ca>

Revision 22897  Directory Listing
Modified Mon Feb 24 22:28:45 2014 UTC (3 years, 7 months ago) by jcfr
COMP: Fix unused variable warnings.

Revision 22896  Directory Listing
Modified Mon Feb 24 22:28:42 2014 UTC (3 years, 7 months ago) by jcfr
ENH: Improve readability using vtkNew where possible

In addition to be shorter, it simply conveys the idea of locally
instantiating an object.

Indeed, vtkNew allow to instantiate an object on the heap and deleting it
when it goes out of scope if its reference count has not been incremented by
either assigning the object to a smart pointer or calling Register.

This commit continues the work initiated in commit r22539

Revision 22887  Directory Listing
Modified Tue Feb 18 16:56:16 2014 UTC (3 years, 7 months ago) by alexy
ENH: Added tests for BSpline and Grid transforms and corresponding MRML nodes.

Revision 22883  Directory Listing
Modified Sat Feb 15 21:31:27 2014 UTC (3 years, 7 months ago) by jcfr
ENH: Add second pimpl constructor to qMRMLTreeView

Adding a second protected constructor that takes the pimpl instance as argument allows subclassing and using qMRMLTreeViewPrivate from a subclass of the tree view.

Export qMRMLWidgets_INCLUDE_DIRS CMake variable from SlicerConfig to be able to include those directories without CMake path construction magic.

From: Csaba Pinter <csaba.pinter@queensu.ca>

Revision 22882  Directory Listing
Modified Sat Feb 15 21:18:59 2014 UTC (3 years, 7 months ago) by alexy
BUG: Fix BSpline transform reducing "event thrashing"

Revision 22881  Directory Listing
Modified Sat Feb 15 00:03:53 2014 UTC (3 years, 7 months ago) by naucoin
BUG: back out table range for LUTs from file

Painting in the editor is not showing the correct
colors when the table range is set to 0-255, go back
to using the maxID as the upper range for now.

Issue #3586


Revision 22878  Directory Listing
Modified Fri Feb 14 19:48:51 2014 UTC (3 years, 7 months ago) by naucoin
BUG: fix table range on color nodes

Color table range values were being set to the number of entries
in the look up table, rather than the range of scalar values that
are to be mapped through the table. This restricts that mapping (especially
when using them with volumes) to for example scalar values from 0-43
in the fMRI table, rather than allowing mapping of 0-255, the default
that is input to the map scalars to colors filter in the
slice pipeline.

Reset the table ranges on the fMRI, fMRIPA, Iron nodes, as well as
the default range for Copy and the color table storage node, to
allow mapping 0-255 rather than 0-number of colors.

Issue #3586


Revision 22875  Directory Listing
Modified Fri Feb 14 16:10:47 2014 UTC (3 years, 7 months ago) by alexy
ENH: Made Markup and Annotation work with non-linear transforms

From: Alex Yarmarkovich <alexy@bwh.harvard.edu>

Revision 22874  Directory Listing
Modified Fri Feb 14 16:10:27 2014 UTC (3 years, 7 months ago) by alexy
ENH: changes to support non-linear transforms

From: Alex Yarmarkovich <alexy@bwh.harvard.edu>

Revision 22873  Directory Listing
Modified Fri Feb 14 16:09:59 2014 UTC (3 years, 7 months ago) by alexy
COMP: Move vtkImageResliceMask from MRML/Logic to MRML/Core

This is done anticipating the implementation of the
non-linear transform support that will expect MRML node to depend on the
functionality of the vtkImageResliceMask filter.

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 22872  Directory Listing
Modified Fri Feb 14 16:09:48 2014 UTC (3 years, 7 months ago) by alexy
STYLE: Remove trailing white space from vtkImageResliceMask files

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 22869  Directory Listing
Modified Tue Feb 11 16:51:34 2014 UTC (3 years, 7 months ago) by jcfr
ENH: Add support for user-defined stereo-viewing options

This will make it easier to implement support new stereoscopic 3D devices.

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 22868  Directory Listing
Modified Sun Feb 9 20:14:14 2014 UTC (3 years, 7 months ago) by pieper
BUG: add missing return statements when read fails - led to crash

ReadDataInternal is meant to return a status code indicating success
or failure, however some branches that generated error messages
neglected to return 0 meaning that the calling code interpreted
this as a success condition.  In some cases this led to a crash, for
example when importing RGB dicom files.

Revision 22861  Directory Listing
Modified Wed Feb 5 21:00:31 2014 UTC (3 years, 7 months ago) by jcfr
ENH: Ensure qMRMLColorModel::ItemDataRole can be used from python

Revision 22856  Directory Listing
Modified Mon Feb 3 18:40:23 2014 UTC (3 years, 7 months ago) by jcfr
ENH: Make layoutManager() method in qMRMLLayoutWidget Q_INVOKABLE

To make it accessible from python

From: Csaba Pinter <csaba.pinter@queensu.ca>

Revision 22852  Directory Listing
Modified Mon Jan 27 14:29:57 2014 UTC (3 years, 7 months ago) by jcfr
ENH: MRMLLayoutManager - Add methods to all slice or 3D views

Revision 22818  Directory Listing
Modified Tue Jan 14 18:58:18 2014 UTC (3 years, 8 months ago) by jcfr
COMP: vtkTeem - Remove cmake configuration warning

CMake Warning (dev) in Libs/vtkTeem/CMakeLists.txt:
  Syntax Warning in cmake code at
      Slicer/Libs/vtkTeem/CMakeLists.txt:21:55

  Argument not separated from preceding token by whitespace.

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 22811  Directory Listing
Modified Fri Jan 10 00:33:34 2014 UTC (3 years, 8 months ago) by naucoin
ENH: add a new color node, continous around 0.0

Add a method to create a new procedural color node that's useful for
visualizing error statistics centered around 0, called RedGreenBlue.
Rename AddRandomNode to AddDefaultProceduralNodes and add the RandomIntegers as
well as the new RedGreenBlue node in it. This will provide a space to add
new default procedural color nodes.
Create a new color node category, Continuous, and place the new node
in it.


Revision 22810  Directory Listing
Modified Thu Jan 9 23:43:47 2014 UTC (3 years, 8 months ago) by naucoin
BUG: use vtkNew for copied look up tables

Use vtkNew to define new color look up table and
color transfer function for copying to the actor's
mapper for models.


Revision 22808  Directory Listing
Modified Thu Jan 9 00:22:16 2014 UTC (3 years, 8 months ago) by naucoin
BUG: check for color transfer functions first

Procedural color nodes may have color look up tables defined,
check for that node class first and if it has a color transfer
function, use it on the model instead.


Revision 22804  Directory Listing
Modified Tue Jan 7 18:12:49 2014 UTC (3 years, 8 months ago) by finetjul
BUG: Cleanup ROI widget and representation

This reverts commit r22803 inadvertently pushed.

Revision 22803  Directory Listing
Modified Tue Jan 7 18:09:37 2014 UTC (3 years, 8 months ago) by finetjul
STYLE: Cleanup ROI widget and representation

Add vtkMRMLDisplayNode::GetBounds() utility method.

Revision 22802  Directory Listing
Modified Tue Jan 7 05:44:32 2014 UTC (3 years, 8 months ago) by jcfr
STYLE: Consistently report error in vtkMRMLNRRDStorageNode read/write method

Revision 22801  Directory Listing
Modified Tue Jan 7 05:44:27 2014 UTC (3 years, 8 months ago) by jcfr
BUG: Fix reading of DWI files. Fixes #3545

This commit fixes regression introduced by commit r22753 fixing issue #3511
that was preventing "vtkNRRDReader::CanReadFile" from returning the correct
value.

Revision 22790  Directory Listing
Modified Fri Dec 20 02:47:04 2013 UTC (3 years, 9 months ago) by jcfr
STYLE: Update doxygen comment of vtkMRMLScene::AddReferencedNodeID

The comment document the changes introduced by commit r22669

From: Andras Lasso <lasso@queensu.ca>

Revision 22789  Directory Listing
Modified Fri Dec 20 02:46:54 2013 UTC (3 years, 9 months ago) by jcfr
STYLE: Improve readability of vtkMRMLScene::AddReferencedNodeID method

This commit does not introduced any functional change, it just makes
the code cleaner.

From: Andras Lasso <lasso@queensu.ca>

Revision 22788  Directory Listing
Modified Fri Dec 20 02:46:42 2013 UTC (3 years, 9 months ago) by jcfr
BUG: Added missing node references update to scene->AddNode methods

Fixes http://na-mic.org/Mantis/view.php?id=3539.

Problem was that node references were not updated in the scene when
node->SetScene(scene) was called for the node before scene->AddNode(node).

From: Andras Lasso <lasso@queensu.ca>

Revision 22778  Directory Listing
Modified Tue Dec 17 07:30:53 2013 UTC (3 years, 9 months ago) by jcfr
COMP: Export qMRMLTreeViewPrivate class

Associated discussion: http://slicer-devel.65872.n3.nabble.com/Export-qMRMLTreeViewPrivate-tt4030532.html#a4030536

From: Csaba Pinter <csaba.pinter@queensu.ca>

Revision 22777  Directory Listing
Modified Tue Dec 17 07:30:49 2013 UTC (3 years, 9 months ago) by jcfr
STYLE: Add warning in pimpl headers explaining it is not part of Slicer API

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 22768  Directory Listing
Modified Fri Dec 6 19:14:16 2013 UTC (3 years, 9 months ago) by jcfr
ENH: Remove redundant vtkImageAccumulateDiscrete already provided by VTK

Using Slicer implementation of the ImageAccumulate filter is equivalent
to the VTK implementation after setting ComponentExtent and ComponentOrigin
appropriately to account for signed 16-bit images.

Output of the filter have been verified for both MRHead and ChestCT
sample data.

Associated discussion: http://slicer-devel.65872.n3.nabble.com/Slicer-vtkImageAccumulateDiscrete-Should-we-just-use-the-class-provided-by-VTK-tp4030447p4030451.html

See #3485

Revision 22766  Directory Listing
Modified Thu Dec 5 15:04:13 2013 UTC (3 years, 9 months ago) by jcfr
COMP: Remove unused ivar from vtkMRMLScalarVolumeNode

Following commit r17798, calculation of [Scalar]AutoLevels has been
moved into vtkMRMLScalarVolumeDisplayNode. Therefore, the file has been
updated.

Revision 22764  Directory Listing
Modified Thu Dec 5 00:05:06 2013 UTC (3 years, 9 months ago) by jcfr
COMP: Fix windows MRMLApplicationLogicTest1 build error (introduced by r22759)

Revision 22761  Directory Listing
Modified Wed Dec 4 15:25:14 2013 UTC (3 years, 9 months ago) by jcfr
COMP: Fix windows build error due to missing include (introduced by r22759)

Revision 22759  Directory Listing
Modified Tue Dec 3 23:03:32 2013 UTC (3 years, 9 months ago) by jcfr
COMP: Remove unnecessary includes in vtkMRMLAbstractLogic header

This has the side effect of having a faster compilation

External module OpenIGTLinkIF and MultiVolumeExplorer have already been
updated according to change in vtkMRMLAbstractLogic header.
See #3493 / r22712  and  #3494 / r22693

On the other hand, no test build have been done for the extension. Issue
will be resolved on case by case following the dashboard results.

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Julien <julien.finet@kitware.com>

Revision 22754  Directory Listing
Modified Tue Dec 3 00:13:02 2013 UTC (3 years, 9 months ago) by jcfr
BUG: Fixed scene view node memory leak. Fixes #3515

From: Andras Lasso <lasso@queensu.ca>

Revision 22753  Directory Listing
Modified Mon Dec 2 21:52:56 2013 UTC (3 years, 9 months ago) by jcfr
BUG: Made file extension comparisons case-insensitive. Fixes #3511

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Andras Lasso <lasso@queensu.ca>

Revision 22745  Directory Listing
Modified Fri Nov 29 06:10:23 2013 UTC (3 years, 9 months ago) by jcfr
COMP: Do not python wrap RemoteIO library.

Revision 22744  Directory Listing
Modified Tue Nov 26 23:20:11 2013 UTC (3 years, 9 months ago) by jcfr
COMP: Removed unused/unmaintained RemoteIO classes and FetchMI module logic

For future references, the corresponding code has been added to
the Slicer attic. See Slicer/Attic@53262c8

From discussion with Steve and Andras:

// --------------------
(1) Jc - Nov 26, 2013

I notice that the only reason we depend on curl is for existence
of RemoteIO library that has been "replaced" by SampleData
and DataStore.

I really like the concept of registering URI that could be
downloaded that is why we should keep the infrastructure in place.

That said, I was thinking to get remove the following classes:

vtkHIDHandler.h
vtkHIDTagTable.h
vtkSRBHandler.h
vtkXNATHandler.h
vtkXNDHandler.h
vtkXNDTagTable.h

Then, we could implement a Qt based  vtkHTTPHandler handler, that
way we could simply remove the curl dependency.

In the mean time, I would also remove the FetchMI logic which is
not maintained or used at that point.

Let me know what you think,

// --------------------
(2) Andras - Nov 26, 2013

It’s always a good idea to make the core smaller and simpler, so
I support the idea of getting rid of unused classes and unnecessary
dependencies.

We planned to use curl for uploading training results in a .zip
file to Moodle, but I guess we can add curl to our module then.

// --------------------
(3) Jc - Nov 26, 2013

Thanks for commenting.

If your module is a loadable or a scripted module, all "curl"
functionality can be provided by Qt. Would that work for you ?

// --------------------
(4) Andras - Nov 26, 2013

We would need quite complex curl functionalities for uploading data,
see the scripts below:

https://gist.github.com/Joshkunz/4516316

https://github.com/proyectoeduhub/moodle-cli/blob/master/moodle-file-upload-curl.sh

Would it be feasible to implement these?

// --------------------
(5) Jc - Nov 26, 2013

Good point. The plan would then be to:

  (1) remove dependency of Slicer core against curl

  (2) Only, build both the Curl library and the curl executable, keeping
 them in the package.

That way, it would provide great flexibility with minimum overhead.

// --------------------
(6) Steve - Nov 26, 2013

Sounds like an excellent plan.

Yes, I like the design of the remote IO support in MRML, but it's not
 being used and is great to simplify wherever possible.  FetchMI can
go away for now, with the hope that we'll reproduce and improve on
it in the future (someday).

Revision 22740  Directory Listing
Modified Tue Nov 26 05:37:17 2013 UTC (3 years, 10 months ago) by jcfr
COMP: Optionally configure Slicer inner project with OpenSSL options.

This is needed because following commit r22734 RemoteIO library is
linked against OpenSSL.

Revision 22739  Directory Listing
Modified Tue Nov 26 01:05:59 2013 UTC (3 years, 10 months ago) by jcfr
COMP: External_curl: Fix build issue + Build against patched 7.34.0 release

This commit install the project so that all needed headers are all
in the same folder.

It also change the version of curl to 7.34.0 with an additional patch
adding CURL_STATICLIB to curlbuild.h to fix build issue on windows
and unix system.

Finally, it reverts r22728 which was incorrectly addressing the build
error described in the corresponding commit message.

Revision 22734  Directory Listing
Modified Mon Nov 25 20:28:53 2013 UTC (3 years, 10 months ago) by jcfr
COMP: Explicitly link RemoteIO against OpenSSL

Given that since commit r22724  curl library is linked against OpenSSL
and that since commit r22732 it is statically built. This commit
explicitly link the shared library RemoteIO against OpenSSL
because the curl static library doesn't provide information how to
resolve the OpenSSL symbol.

Revision 22724  Directory Listing
Modified Sun Nov 24 08:09:34 2013 UTC (3 years, 10 months ago) by jcfr
COMP: Support Slicer_USE_SYSTEM_* option. Fixes #1739

This commit implements four main changes:

  (1) it updates Slicer build system to support configuring Slicer passing
      Slicer_USE_SYSTEM_* CMake variables

  (2) it updates to a newer version of CTK able to understand CTK_USE_SYSTEM_*
      options. List of CTK contribution associated with this update are
      reported below.

  (3) it changes curl library from "slicerlibcurl/cmcurl/curl" v7.12.1
      to the more recent official CMake'ified curl v7.33.0. This has the
      benefit of making it easier to build against the corresponding
      system library.

  (4) It implements workaround allowing some CLIs to built on Debian-like
      distribution that is providing DCMTK 3.6.0.
      See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637687
      EMSegment project has also been updated to implement a similar
      workaround.

The macro "SlicerMacroCheckExternalProjectDependency" allowing to
recursively traverse the external project dependency tree has been
updated.

The traversal is now done in two passes. The first pass traverses the
complete tree to set the value of Slicer_USE_SYSTEM_*.

The second pass invokes the "ExternalProject_Add" function and displays
informative messages. In addition to the usual "[OK]" and "[INCLUDED]"
suffixes, an additional text "(SYSTEM)" is displayed. It means the
corresponding libraries (and headers) installed on the system will be
used.

On Ubuntu 13.10, support for the following options have been
tested simultaneously:
  -DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=ON
  -DSlicer_USE_SYSTEM_python:BOOL=ON
  -DSlicer_USE_SYSTEM_DCMTK:BOOL=ON
  -DSlicer_USE_SYSTEM_LibArchive:BOOL=ON
  -DSlicer_USE_SYSTEM_curl:BOOL=ON
  -DSlicer_USE_SYSTEM_teem:BOOL=ON
  -DSlicer_USE_SYSTEM_OpenIGTLink:BOOL=ON
  -DSlicer_USE_SYSTEM_OpenSSL:BOOL=ON # Implicitly set because python depends
                                      # on OpenSSL.
  -DSlicer_BUILD_OpenIGTLinkIF:BOOL=OFF # Only openigtlink version1 are available
                                        # and code does NOT supports only v2.

To successfully build Slicer against system libraries, the corresponding
packages have been installed:
  sudo apt-get install libssl-dev \
    libdcmtk-dev \
    libarchive-dev \
    libpython2.7-dev \
    python-numpy \
    libcurl4-openssl-dev \
    libteem-dev \
    tk-dev \
    tcl-dev \
    itcl3-dev \
    libopenigtlink1-dev

While not tested, support for the following option has also been
implemented:
  -DSlicer_USE_SYSTEM_ITKv4:BOOL=ON
  -DSlicer_USE_SYSTEM_VTK:BOOL=ON

CTK updates:

$ git shortlog  91cdf9e0f...02ecc27d0

Jean-Christophe Fillion-Robin (39):
      Ensure CTK_INSTALL_QTPLUGIN_DIR is properly set
      Ensure "CMAKE_INSTALL_PREFIX" is properly passed to inner project.
      By default, do not install application headers
      Install CTK's *.cmake files
      Merge branch '65-packaging-support' into 403-relocatable-ctkconfig-usectk
      Set plugin install rules for target and include files
      Remove commented code and unused vars from CTKConfig / CTKGenerateCTKConfig
      Explicitly set default value for CTK_INSTALL_QTPLUGIN_DIR
      Remove explicit setting of CMake policies.
      Improve FindDCMTK.cmake documentation
      Add DCMTK 3.6.0 support to ctkDICOMUtil.cpp
      Ensure DCMTK libraries can be found on system without setting DCMTK_DIR
      FindDCMTK - Workaround bug in packaging of DCMTK 3.6.0 on Debian.
      Add support for install-able and relocatable package.
      Merge branch '382-fix-find-dcmtk-issue'
      Merge branch '403-relocatable-ctkconfig-usectk'
      Merge branch '405-support-dcmtk-360'
      Fix -Wunused-but-set-variable in transfer function tests
      Merge branch '209-fix-vtk-transfer-function-test-warnings'
      Fix linking of VTKCoreCppTest by adding a check for linker capabilities
      Merge branch 'fix-vtk-core-test-link-error'
      COMP: FindDCMTK - Exclude -D from DCMTK_DEFINITIONS for easier re-use
      Merge branch '382-fix-find-dcmtk-issue'
      Associate DCMTK_DEFINITIONS to CTKDICOMCore
      Merge branch '413-associated-dcmtk-definitions-to-ctkdicomcore'
      Merge pull request #410 from NifTK/409-widgets-on-ctkPopupWidget-do-not-get-keyboard-focus
      Add DCMTK 3.6.0 support to CTK application.
      Merge branch '405-support-dcmtk-360'
      Fix configuration of CTKConfig based on DCMTK_HAVE_CONFIG_H_OPTIONAL value
      Merge branch '413-associated-dcmtk-definitions-to-ctkdicomcore'
      Add convenience function "ctk_list_to_string"
      Automatically reformat list passed to "CTK" inner build.
      COMP: Add support for CTK_USE_SYSTEM_* options
      Merge branch '418-support-use-system-option'
      FindDCMTK - Do not explicitly set DCMTK_DEFINITIONS
      FindDCMTK - Clean white spaces
      Merge branch '382-fix-find-dcmtk-issue' into 413-associated-dcmtk-definitions-to-ctkdicomcore
      Associate CTKDICOMCore with DCMTK_DEFINITIONS in build and install tree
      Merge branch '413-associated-dcmtk-definitions-to-ctkdicomcore'

Miklos Espak (1):
      Active window flag transferred on RequestSoftwareInputPanel event

Steve Pieper (2):
      Put all tags for a given instance into a list for a single batch insert
      Merge pull request #415 from pieper/414-batch-insert-tags

See #1739

Revision 22723  Directory Listing
Modified Sun Nov 24 08:09:22 2013 UTC (3 years, 10 months ago) by jcfr
COMP: ExternalProject - Simplify and document Teem external project

Teem version >= 1.10 is now explicitly required.

See #1739

Revision 22713  Directory Listing
Modified Mon Nov 18 20:37:20 2013 UTC (3 years, 10 months ago) by jcfr
BUG: Fixed translation sliders in local coordinate reference mode.

In local coordinate reference mode the slider positions do not match
directly with the transformation matrix values.

Similarly to rotation sliders, only relative positions are set
with the sliders in local coordinate reference mode.

Fixes #3488

From: Andras Lasso <lasso@queensu.ca>

Revision 22700  Directory Listing
Modified Thu Nov 14 16:12:56 2013 UTC (3 years, 10 months ago) by jcfr
ENH: Added test for MRML node reference serialization and parsing
Issue #3416

From: Csaba Pinter <csaba.pinter@queensu.ca>

Revision 22685  Directory Listing
Modified Wed Nov 6 19:56:48 2013 UTC (3 years, 10 months ago) by lassoan
BUG: Fixed volume rendering presets issue (presets were not displayed)

The scene model RowCache was temporarily outdated during node insertion. If the cache was accessed during node insertion, the qMRMLSceneModel::indexFromNode method indicated that the node doesn't exist yet.
Fixed by adding an entry to the cache with the node-to-be-added, which results in not using the cache to determine if the node exists or not but uses the traditional way of iterating through all the items.

Revision 22680  Directory Listing
Modified Mon Nov 4 21:18:41 2013 UTC (3 years, 10 months ago) by jcfr
COMP: vtkITK - Update GetJacobian() to make transform ITKv4 compliant

This patch is necessary to compile Slicer with a system ITKv4 library.

For more info see the ITKv4 migration guide.
http://itk.org/migrationv4/index.php?action=artikel&cat=3&id=110&artlang=en

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Dominique Belhachemi <domibel@debian.org>

Revision 22676  Directory Listing
Modified Sun Nov 3 23:07:48 2013 UTC (3 years, 10 months ago) by jcfr
STYLE: Avoid confusion renaming SceneView API: "Nodes" into "StoredScene"

The following renaming have been done:
 - ivar Nodes -> StoredScene
 - method "UpdateSnapshotScene" -> "UpdateStoredScene"
 - method "GetNodes" -> "GetStoredScene"

Also remove the unused parameter from "UpdateStoredScene"

Revision 22675  Directory Listing
Modified Sun Nov 3 23:07:42 2013 UTC (3 years, 10 months ago) by jcfr
COMP: MRML Scene ivar "ActiveScene" is not unused anymore.

Revision 22674  Directory Listing
Modified Sun Nov 3 23:07:39 2013 UTC (3 years, 10 months ago) by jcfr
COMP: Remove redundant Scene methods: GetClassNameList, GetNodeClasses

The method "GetNodeClassesList" fulfills the same goal.

Revision 22673  Directory Listing
Modified Sun Nov 3 23:07:34 2013 UTC (3 years, 10 months ago) by jcfr
COMP: Simplify MRML Scene API removing SceneModifiedTime methods.

Along with the methods "GetSceneModifiedTime"  and "IncrementSceneModifiedTime",
the ivar SceneModifiedTime has been introduced in r5772.

Considering the Modified time of the scene is in fact returned by the
method "vtkMRMLScene::GetMTime()", having an other method named
"GetSceneModifiedTime" is rather confusing.

Since internally the method "GetSceneModifiedTime" was using the MTime
of the underlying node collection, the existing call to the method
have been changed into "GetNodes()->GetMTime()".

This commit is a follow-up of r18562 where the method "GetCurrentScene()"
has been renamed into "GetNodes()". For reference, the method
"GetCurrentScene()" has itself been introduced in r8315.

Revision 22670  Directory Listing
Modified Thu Oct 31 04:51:14 2013 UTC (3 years, 10 months ago) by jcfr
STYLE: Move vtkMRMLScene method definitions into implementation file.

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 22669  Directory Listing
Modified Thu Oct 31 04:51:11 2013 UTC (3 years, 10 months ago) by jcfr
ENH: Optimized performance of observations management in vtkMRMLScene

Use a std::map< std::string, std::set<std::string> > instead of two
separate ReferencedIDs and ReferencingNodes vectors to make lookup,
insertion, and deletion much faster (especially scene close takes much
shorter time now).
Store both referenced and referring nodes by ID. It is simpler, safer,
and most of the time the node pointers were validated anyway using
scene->GetNodeFromID(node->GetID().

Also, use set instead of vector for storing unique IDs for improving
performance of scene loading (especially when the same scene is loaded
twice and a lot of IDs have to be generated).

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Andras Lasso <lasso@queensu.ca>

Revision 22668  Directory Listing
Modified Thu Oct 31 04:51:06 2013 UTC (3 years, 10 months ago) by jcfr
STYLE: Simplify code using vtkNew to register node with MRML scene

From: Andras Lasso <lasso@queensu.ca>

Revision 22667  Directory Listing
Modified Thu Oct 31 04:51:03 2013 UTC (3 years, 10 months ago) by jcfr
ENH: Improved performance of qMRMLSceneModel

The indexFromNode method is called millions of times when there are a few hundred nodes and it browses through the whole model to find the requested node. Add a cache that stores the last search result and use it as a search hint.
New rows are always added to the cache, so the cache alone can be used to determine if a node is not yet in the model.

From: Andras Lasso <lasso@queensu.ca>

Revision 22666  Directory Listing
Modified Thu Oct 31 04:51:00 2013 UTC (3 years, 10 months ago) by jcfr
ENH: Optimized qMRMLSceneModel::nodeIndex performance

qMRMLSceneModel::nodeIndex is called tens of millions of times, therefore it's optimum performance is critical.
Find MRML nodes by object pointer instead of ID comparison to improve the performance.

Also, always do lazyupdate for qMRMLSceneModel if scene is closing to unsubscribe from all events at once the scene is closed.

From: Andras Lasso <lasso@queensu.ca>

Revision 22665  Directory Listing
Modified Thu Oct 31 04:50:56 2013 UTC (3 years, 10 months ago) by jcfr
ENH: vtkEventBroker performance improvement

Use a set instead of a vector to allow faster finding and deletion of observations

From: Andras Lasso <lasso@queensu.ca>

Revision 22663  Directory Listing
Modified Thu Oct 31 04:50:49 2013 UTC (3 years, 10 months ago) by jcfr
ENH: Add BatchUpdateThreshold to Model hierarchy logic

Only use batch processing for show/hide of model hierarchies if the
total number of nodes in the selected branch is larger than a given threshold.

From: Andras Lasso <lasso@queensu.ca>

Revision 22662  Directory Listing
Modified Thu Oct 31 04:50:46 2013 UTC (3 years, 10 months ago) by jcfr
ENH: Don't batch process when show/hide only a few child nodes

When there are many child nodes in a hierarchy then show/hide is much more efficient if batch processing is enabled.
However, if there are few nodes only then a full refresh at the end of a batch processing takes longer than doing the update on each node separately.
Count the number of child nodes and if there are less than 30 then update each node separately.

From: Andras Lasso <lasso@queensu.ca>

Revision 22660  Directory Listing
Modified Thu Oct 31 04:50:40 2013 UTC (3 years, 10 months ago) by jcfr
ENH: Update vtkMRMLNodeTest1 to display error on standard error.

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Revision 22656  Directory Listing
Modified Wed Oct 30 15:17:18 2013 UTC (3 years, 10 months ago) by jcfr
BUG: Simplify logic in (Start|End)SliceNodeInteraction method

Revision 22655  Directory Listing
Modified Wed Oct 30 15:17:16 2013 UTC (3 years, 10 months ago) by jcfr
BUG: Fix missing (Interaction|Selection)Node in qMRMLSliceWidget test

Full name of the test is: qMRMLSliceWidgetEventTranslatorPlayerTest1

The following warning was reported:
//-----------
Warning: In /path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLAbstractDisplayableManager.cxx, line 817
vtkMRMLVolumeGlyphSliceDisplayableManager (0x1548450): SetAndObserveMRMLDisplayableNode - MRMLScene does NOT contain any InteractionNode

Warning: In /path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLAbstractDisplayableManager.cxx, line 583
vtkMRMLVolumeGlyphSliceDisplayableManager (0x1548450): CreateIfPossible - MRMLScene does NOT contain any InteractionNode

Warning: In /path/to/Slicer/Libs/MRML/DisplayableManager/vtkMRMLAbstractDisplayableManager.cxx, line 591
vtkMRMLVolumeGlyphSliceDisplayableManager (0x1548450): CreateIfPossible - MRMLScene does NOT contain any SelectionNode
//-----------

Revision 22654  Directory Listing
Modified Wed Oct 30 15:17:14 2013 UTC (3 years, 10 months ago) by jcfr
BUG: Fix "No LookupTable" error in qMRMLSliceWidget test

Full name of the test is: qMRMLSliceWidgetEventTranslatorPlayerTest1

The following error was reported:

//----------------------
ERROR: In /path/to/VTK/Imaging/vtkImageMapToColors.cxx, line 153
vtkImageMapToColors (0x268f190): RequestInformation: No LookupTable was set but number of components in input doesn't match OutputFormat, therefore input can't be passed through!

ERROR: In /path/to/VTK/Imaging/vtkImageExtractComponents.cxx, line 239
vtkImageExtractComponents (0x26947e0): Execute: Component 1 is not in input.

ERROR: In /path/to/VTK/Imaging/vtkImageExtractComponents.cxx, line 239
vtkImageExtractComponents (0x26947e0): Execute: Component 1 is not in input.
//----------------------

It is fixed by adding colorNodeRef attribute to VolumeDisplay element.

Also documented in the FAQ: http://wiki.slicer.org/slicerWiki/index.php?title=Documentation/Nightly/Developers/FAQ#Developer_FAQ:_MRML

Revision 22614  Directory Listing
Modified Thu Oct 17 00:34:22 2013 UTC (3 years, 11 months ago) by lassoan
BUG: Added string length check in vtkMRMLNode::GetReferenceRoleFromMRMLAttributeName to fix Slicer crash when loading a scene

Revision 22611  Directory Listing
Modified Mon Oct 14 15:58:40 2013 UTC (3 years, 11 months ago) by naucoin
BUG: fix typo in AdditionalInitializeStep method name

Fixing a mis spelling in the additional initialize step method name.
In vtkMRMLAbstractDisplayableManager it's defined as:
AdditionalInitializeStep
but vtkMRMLCameraDisplayableManager was using:
AdditionnalInitializeStep
with an extra n. Using that signature, it was never getting called
so when new layout windows were being created, the active camera
was not getting set on the renderer.

Issue #1690


Revision 22610  Directory Listing
Modified Sun Oct 13 16:29:53 2013 UTC (3 years, 11 months ago) by alexy
BUG: 3416. Added generic mechanism for persisting node references in .mrml files. 
References stored in the form: references="role1:id1 id2 iid3;role2:id3;". Note that for backwards compatibility the  reference nodes such as displayable, transformable etc. still read/write their references the old way. Only custom references will use new syntax.

Revision 22607  Directory Listing
Modified Tue Oct 8 20:34:56 2013 UTC (3 years, 11 months ago) by millerjv
BUG: Read vectors as scalars

3-vectors were read as Vectors and placed on PointData.
All other vector lengths are read as multi-component Scalars
on PointData.

This patch treats all vectors as scalars to be consistent.

Revision 22604  Directory Listing
Modified Sun Oct 6 22:52:17 2013 UTC (3 years, 11 months ago) by alexy
BUG: fixed problems and test failures introduced by r22603.

Revision 22603  Directory Listing
Modified Sat Oct 5 14:04:57 2013 UTC (3 years, 11 months ago) by alexy
BUG: 3436. Fixed node references to use predefined events. Made reference code similar between Diaplayable and Transformable references. This is also continuation of work on bug 3388.

Revision 22602  Directory Listing
Modified Fri Oct 4 18:33:25 2013 UTC (3 years, 11 months ago) by naucoin
ENH: test getting displayable managers to 3D view

To match the test added in svn 22583, make sure that
the expected list of displayable managers is present on the
3D view.


Revision 22594  Directory Listing
Modified Thu Oct 3 22:06:24 2013 UTC (3 years, 11 months ago) by jcfr
BUG: Fix vtkMRMLSceneViewNodeStoreSceneTest randomly failing on windows

Allocating a single "vtkMRMLScalarVolumeNode" wasn't enough to ensure
that the space previously used by 'vtkMRMLScalarVolumeNode1' wasn't
available again for the restored volume.

See inlined comment for more details.

Revision 22593  Directory Listing
Modified Thu Oct 3 21:25:30 2013 UTC (3 years, 11 months ago) by naucoin
BUG: check returned displayable managers

Add list of expected displayable managers and fail test
if returned list doesn't match in size or if returned managers
are not in the list.


Revision 22586  Directory Listing
Modified Thu Oct 3 20:25:21 2013 UTC (3 years, 11 months ago) by jcfr
BUG: Fix vtkMRMLModelHierarchyNodeTest1

Since calling GetID() on a newly instantiated node is expected to
return NULL and that attempting to print a NULL string on windows
results in a crash. The test was failing only on windows.

This commit remove the print statement in the test and also add test
test for GetID and GetNodeTagName to EXERCISE_BASIC_MRML_METHODS so that
the default value for every node is verified.

Since there is already a test printing the value if it fails, also
remove extra debug statement printing the number of children in
the hierarchy node.

Revision 22585  Directory Listing
Modified Thu Oct 3 20:25:19 2013 UTC (3 years, 11 months ago) by jcfr
STYLE: Split MRML Node EncodeString tests into two different tests

Revision 22584  Directory Listing
Modified Thu Oct 3 20:25:17 2013 UTC (3 years, 11 months ago) by jcfr
STYLE: Improve readability of EXERCISE_BASIC_MRML_METHODS macro

This commit makes it easier to read through the different test
associated with the macro.

Revision 22583  Directory Listing
Modified Thu Oct 3 20:04:43 2013 UTC (3 years, 11 months ago) by naucoin
ENH: add abiltiy to get displayable managers on 2d views

Added getDisplayableManagers on the slice view to mirror the
same call on the 3D view. Added testing.


Revision 22574  Directory Listing
Modified Thu Oct 3 14:37:02 2013 UTC (3 years, 11 months ago) by jcfr
STYLE: In SliceControllerWidget, consistently restore "blockSignal" state

Revision 22573  Directory Listing
Modified Thu Oct 3 14:36:59 2013 UTC (3 years, 11 months ago) by jcfr
STYLE: Remove unused "SliceOrientation" ivar from SliceControllerWidget

Revision 22572  Directory Listing
Modified Thu Oct 3 14:36:56 2013 UTC (3 years, 11 months ago) by jcfr
BUG: Fix qMRMLSliceControllerWidgetTest

Following r22568, the controller has been updated so that the abbreviated
slice name can be dynamically updated after the "LayoutLabel" has been
changed on the associated slice node.

This commit clean up the code removing un-needed ivar "SliceViewLabel" and
fix the test.

Finally, also set "sliceViewLabel" as a property so that is accessible
from python.

Revision 22571  Directory Listing
Modified Thu Oct 3 02:34:14 2013 UTC (3 years, 11 months ago) by jcfr
BUG: Fix memory leaks in vtkMRMLModelSliceDisplayableManager

See inlined comment for details.

This commit will also avoid leaks (and by extension ensure they
pass when leaks detection is enabled) in the following tests:
  py_NeurosurgicalPlanningTutorial
  py_ThresholdThreadingTest
  py_NeurosurgicalPlanningTutorial
  py_ScenePerformance

Revision 22568  Directory Listing
Modified Wed Oct 2 19:28:04 2013 UTC (3 years, 11 months ago) by fedorov
ENH: allow dynamic update of the slice viewer label

This feature is helpful to inform the user of the slice viewer content without
using extra screen space. Resolves issue 3427

Revision 22558  Directory Listing
Modified Tue Oct 1 19:56:30 2013 UTC (3 years, 11 months ago) by jcfr
COMP: Fix "-Wunused-but-set-variable" in vtkMRMLModelDisplayableManager

Revision 22540  Directory Listing
Modified Tue Oct 1 19:25:03 2013 UTC (3 years, 11 months ago) by jcfr
BUG: Fix leak in vtkMRMLCameraDisplayableManagerTest1

Revision 22539  Directory Listing
Modified Tue Oct 1 19:25:00 2013 UTC (3 years, 11 months ago) by jcfr
ENH: Improve readability using vtkNew where possible

In addition to be shorter, it simply conveys the idea of locally
instantiating an object.

Indeed, vtkNew allow to instantiate an object on the heap and deleting it
when it goes out of scope if its reference count has been incremented by
either assigning the object to a smart pointer or calling Register.

Revision 22538  Directory Listing
Modified Tue Oct 1 19:24:47 2013 UTC (3 years, 11 months ago) by jcfr
ENH: Improve readability of MRML tests using vtkNew where possible

Simplify code removing tests for null object already being done
in the helper macro "EXERCISE_BASIC_OBJECT_METHODS"

For example, the following should not be needed:

  vtkNew<vtkFoo> foo;
  if (foo.GetPointer() == 0)
  {
    std::cerr << "Failed to instantiate vtkFoo" << std::endl;
  }

Instead, the following should be used:

  EXERCISE_BASIC_OBJECT_METHODS(foo.GetPointer())

Remove use of unnecessary vtkSmartPointer to check return value. Indeed,
since the operator "==" of the vtkSmartPointer is overloaded to compare with
the pointed object, there is no need to used a smart pointer. [1]

// ---------
vtkSmartPointer<vtkMRMLDisplayableNode> pnode = node1->GetDisplayableNode();
std::cout << "GetDisplayableNode returned "
          << (pnode == NULL ? "null" : "not null")
          << std::endl;
// ---------

has been changed into

// ---------
vtkMRMLDisplayableNode* pnode = node1->GetDisplayableNode();
std::cout << "GetDisplayableNode returned "
          << (pnode == NULL ? "null" : "not null")
          << std::endl;
// ---------

[1] https://github.com/Kitware/VTK/blob/0e0674a3695fdeaf01ce87dfc04e32111b7402e0/Common/vtkSmartPointerBase.h#L104

Revision 22537  Directory Listing
Modified Tue Oct 1 19:24:35 2013 UTC (3 years, 11 months ago) by jcfr
ENH: Update qMRMLLayoutManagerTest2 to check for reference count

Revision 22536  Directory Listing
Modified Tue Oct 1 19:24:33 2013 UTC (3 years, 11 months ago) by jcfr
STYLE: Update "removeSliceView" to be consistent with other remote methods

Revision 22535  Directory Listing
Modified Tue Oct 1 19:24:31 2013 UTC (3 years, 11 months ago) by jcfr
STYLE: Re-organize qMRMLLayoutManagerTest(1|2|3|4) for easier readability

Factor out code into convenience functions:
 - checkViewArrangement
 - checkNumberOfItems

Use vtkNew when possible

There is no need to explicitly delete the layout manager since
it was a QWidget instantiated on the stack as a parent.

Revision 22534  Directory Listing
Modified Tue Oct 1 19:24:29 2013 UTC (3 years, 11 months ago) by jcfr
BUG: Fix qMRMLLayoutManagerTest2

Ensure ModelDisplayableManager properly delete resources when
a new scene is set.

Ensure the slicer logic set the scene on layers when a new
scene is set a second time.

Revision 22533  Directory Listing
Modified Tue Oct 1 19:24:27 2013 UTC (3 years, 11 months ago) by jcfr
BUG: qMRMLLayoutManagerTest(s) - Fix (Selection|Interaction)Node warnings

This commit will fix the following warnings:

147: Warning: In /home/jchris/Projects/Slicer/Libs/MRML/DisplayableManager/vtkMRMLAbstractDisplayableManager.cxx, line 583
147: vtkMRMLThreeDReformatDisplayableManager (0x2c92750): CreateIfPossible - MRMLScene does NOT contain any InteractionNode
147:
147: Warning: In /home/jchris/Projects/Slicer/Libs/MRML/DisplayableManager/vtkMRMLAbstractDisplayableManager.cxx, line 591
147: vtkMRMLThreeDReformatDisplayableManager (0x2c92750): CreateIfPossible - MRMLScene does NOT contain any SelectionNode

Revision 22531  Directory Listing
Modified Tue Oct 1 00:16:35 2013 UTC (3 years, 11 months ago) by fedorov
ENH: adding 3x3 layout

see issue 2384

Revision 22530  Directory Listing
Modified Mon Sep 30 23:35:48 2013 UTC (3 years, 11 months ago) by fedorov
BUG: fix the numbering of slice viewer labels

In the situations when Yellow/Green/Red viewers are present, the additional viewers should be numbered starting from 4.

Revision 22529  Directory Listing
Modified Mon Sep 30 23:25:21 2013 UTC (3 years, 11 months ago) by fedorov
STYLE: fix the grey slice viewers labels to be distinctive

Per comment from Jim, see issue 2384

Revision 22527  Directory Listing
Modified Fri Sep 27 22:56:55 2013 UTC (3 years, 11 months ago) by alexy
BUG: 3388. Fixed crash in test when referenceRole=0

Revision 22525  Directory Listing
Modified Fri Sep 27 19:18:24 2013 UTC (3 years, 11 months ago) by jcfr
COMP: Fix "unused-but-set-variable" warning in qMRMLItemDelegate

Revision 22524  Directory Listing
Modified Fri Sep 27 18:43:01 2013 UTC (3 years, 11 months ago) by alexy
BUG: 3413. Fixed crash on writing a custom reference.

Revision 22523  Directory Listing
Modified Fri Sep 27 18:19:55 2013 UTC (3 years, 11 months ago) by alexy
BUG: 3388. Added observer events parameter to the vtkMRMLNode::AddNodeReferenceRole() method, so that the events can be set only once in subclasses. Added observed events to DisplayableNode and TransformableNode. Simplified and unified reference implementation in TransformableNode

Revision 22486  Directory Listing
Modified Wed Sep 25 04:31:00 2013 UTC (4 years ago) by jcfr
BUG: Fix compile error introduced when backporting fix for MGH origin issue

The compile issue hasn't been detected earlier because only a visual check
between the original patch (Slicer/itkMGHImageIO@13f5e11ef) and
the back-ported one has been done (r22485).

This commit fixes the build issue and also confirm that the associated
Slicer tests now pass:

// --------------
Start 545: py_nomainwindow_test_slicer_mgh
[...]
test_saveShortCompressedNode (test_slicer_mgh.SlicerUtilLoadSaveMGHTests) ... ok
test_saveUnCompressedNode (test_slicer_mgh.SlicerUtilLoadSaveMGHTests) ... ok
// --------------

Revision 22485  Directory Listing
Modified Wed Sep 25 04:03:36 2013 UTC (4 years ago) by jcfr
COMP: Fix bug in writing origins to MGH files

Waiting Slicer makes use of the ITK remote module "itkMGHImageIO" (issue #3410),
this commit has been back-ported from Slicer/itkMGHImageIO@13f5e11ef.

It also has been tested by Hans as part of ITK.

Test project /Users/johnsonhj/Dashboard/src/ITK-ccache
Start 2065: MGHIOInDoxygenGroup
1/7 Test #2065: MGHIOInDoxygenGroup .............. Passed 0.09 sec
Start 2066: MGHFactoryCreationTest
2/7 Test #2066: MGHFactoryCreationTest ........... Passed 0.15 sec
Start 2067: MGHReadImagesTest_mgz
3/7 Test #2067: MGHReadImagesTest_mgz ............ Passed 3.77 sec
Start 2068: MGHReadImagesTest_mgh
4/7 Test #2068: MGHReadImagesTest_mgh ............ Passed 0.49 sec
Start 2069: MGHReadImagesTest_mgh.gz
5/7 Test #2069: MGHReadImagesTest_mgh.gz ......... Passed 3.88 sec
Start 2070: itkMGHIOInternalTests
6/7 Test #2070: itkMGHIOInternalTests ............ Passed 0.07 sec
Start 2071: itkMGHIOOriginTest
7/7 Test #2071: itkMGHIOOriginTest ............... Passed 3.58 sec

More details here: http://review.source.kitware.com/#/c/12771/

From: Kent Williams <norman-k-williams@uiowa.edu>

Revision 22480  Directory Listing
Modified Tue Sep 24 19:46:29 2013 UTC (4 years ago) by naucoin
STYLE: updated documentation on selection node

Updated doxygen comments to note that the PlaceNodeClassName
calls replace the AnnotationNodeID calls. 
Fixed a merge error on the enum, fixing the overwriting of event
numbers and moved the UnitModifiedEvent to be last.
Updated doxygen comments on the annotation fiducial node to
note it as deprecated moving the top level description so that
it shows up on the generated pages.


Revision 22458  Directory Listing
Modified Thu Sep 19 17:43:30 2013 UTC (4 years ago) by naucoin
BUG: fix crash on exit for py_MarkupsSceneViewRestoreTestManyLists

On some runs of the py_MarkupsSceneViewRestoreTestManyLists test, the
volume rendering displayable manager would trigger a segmentation
fault when it was being deleted on exit. It came from requesting
a render after setting and observing the NULL displayable node.
Added a test for a null node and if true don't request a render.
Tested via the GUI and ran the volume rendering tests.
 

Revision 22422  Directory Listing
Modified Tue Sep 10 16:11:17 2013 UTC (4 years ago) by naucoin
BUG: fixing a Markups merge error for the active place node

The more general activePlaceNodeID is to be used instead of a specific 
Annotations or Markups variable name.

Fixed while working on issue #3296 for the 4.3.1 release.


Revision 22405  Directory Listing
Modified Wed Sep 4 09:28:02 2013 UTC (4 years ago) by jcfr
BUG: Add ".mgh.gz" to the list of FreeSurferModelOverlay read file types.

Revision 22404  Directory Listing
Modified Wed Sep 4 09:27:59 2013 UTC (4 years ago) by jcfr
BUG: Fix "py_nomainwindow_test_slicer_mgh" allowing "mgh" to be saved

Revision 22403  Directory Listing
Modified Wed Sep 4 09:27:56 2013 UTC (4 years ago) by jcfr
BUG: Fix loading of ".mgh.gz" file in py_nomainwindow_test_slicer_mgh

Method "IsCompressedFilename" has been copied from the improved fork
of MGHImageIO maintained by ITK folks (Hans).
See https://github.com/Slicer/itkMGHImageIO

Revision 22402  Directory Listing
Modified Wed Sep 4 09:27:53 2013 UTC (4 years ago) by jcfr
COMP: Fix unused variable warnings

Revision 22394  Directory Listing
Modified Tue Sep 3 18:29:44 2013 UTC (4 years ago) by jcfr
BUG: Fix crash preventing the same color file to be loaded more than once

As the documentation associated "AddNode" method explains, in the case
of singleton node, the return node should be considered instead of the
one passed to the method.

AddNode documentation:

/// [...]
/// If node is a singleton, and a node of the same class with the
/// same singleton tag already exists in the scene, \a nodeToAdd is NOT
/// added but its properties are copied (c.f. vtkMRMLNode::CopyWithScene())
/// into the already existing singleton node. That node is then returned.

Fixes #2989

Revision 22386  Directory Listing
Modified Tue Sep 3 03:10:31 2013 UTC (4 years ago) by jcfr
ENH: Associate icon with the new Slice view layouts

This is a follow-up of previous commit r22385

See #2384

From: Andrey Fedorov <fedorov@bwh.harvard.edu>

Revision 22385  Directory Listing
Modified Mon Sep 2 21:57:29 2013 UTC (4 years ago) by jcfr
ENH: Adding three new layouts

Slice view only configurations added: 4x3, 4x2, 5x2.

See #2384

From: Andrey Fedorov <fedorov@bwh.harvard.edu>

Revision 22376  Directory Listing
Modified Sat Aug 31 03:19:57 2013 UTC (4 years ago) by jcfr
COMP: Remove redundant option MRML_USE_Teem and only use MRML_USE_vtkTeem

Fixes #2571

Revision 22369  Directory Listing
Modified Fri Aug 30 18:41:01 2013 UTC (4 years ago) by naucoin
BUG: update WriteCLI to fill a vector of strings, honor mutiple = false

Because Markups define multiple markups (with potentially multiple points) in one node,
it was writting multiple instances of a string + coordinates to the string stream passed
in to WriteCLI. This causes a problem for the parsing of the arguments in CLIs such as
FiducialRegistration which needed a separate string for each point.
With this change, the markup points are writen into a vector of strings, one string
for each point in each Markup.
Added the multipleFlag to be passed to WriteCLI, and if it's false, only write the
first selected markup to the output vector. If that markup has multiple points, it will
write all of those points.
Updated the Annotation control point to use the new WriteCLI signature, but because
of the way the points are written, it will only write the first point in a multi point
annotation (such as a ruler) if multiple is false, so it ignores it and the
CLI module logic takes care of ensuring that only the first child in an
annotation hierachy is written out. Write out a warning message if this is the case.
Added a test for FiducialRegistration, updated the Markups node test 1 to test the single point flag.
Removed trailing white spaces.

Issue #1910 #3345 #3340


Revision 22344  Directory Listing
Modified Tue Aug 27 23:23:35 2013 UTC (4 years ago) by naucoin
BUG: remove color table entries from mrml file

Rely on the file written to disk by the storage node, 
reduces the size of the mrml file.
Keep the number of colors in the mrml file so that the
table is properly initialised.

Issue #2486

Revision 22343  Directory Listing
Modified Tue Aug 27 23:06:53 2013 UTC (4 years ago) by jcfr
BUG: 3241 Fix transform not applied to volume when scene is read from a file

When a scene is loaded, vtkMRMLScene::UpdateNodeReferences doesn't handle event registration.
Except for vtkCommand::ModifiedEvent, any other events need to be registered via OnNodeReferenceAdded API.
Fixes #3241

From: Yuzheng Zhou <yuzheng.zhou@kitware.com>

Revision 22336  Directory Listing
Modified Tue Aug 27 03:29:50 2013 UTC (4 years, 1 month ago) by jcfr
BUG: Exposes RepresentationType and InterpolationType enums to python

Revision 22335  Directory Listing
Modified Tue Aug 27 03:29:48 2013 UTC (4 years, 1 month ago) by jcfr
BUG: Fix serialization of display node representation property

Revision 22331  Directory Listing
Modified Mon Aug 26 17:38:52 2013 UTC (4 years, 1 month ago) by naucoin
BUG: show the color indices rather than row number

The Color GUI was showing a row number starting from 1
when displaying color table entries, which are 0 indexed.
This led to a mismatch between the value shown in the
data probe (and in the actual color node) versus
what the user was being shown to be the color index.

Overloaded the headerData method to, in the case of the
vertical header display role to return the row index
minus 1. The MRML color model defines a ColorEntryRole
but it's still off by 1 from the color index.

Testing of copying a color node exposed the fact that the
new color node was not showing up in the Data module nor
in the Save Data dialog, so updated CopyNode in the color
logic to turn off the hide from editors flag on the new node.

Issue #1892

Revision 22328  Directory Listing
Modified Sun Aug 25 17:37:35 2013 UTC (4 years, 1 month ago) by alexy
BUG: 2816. Store SceneViews data in MRB file even if not present in the main scene for the case when the Scene Views are read from the scene file, the data pointer is NULL in this case.

Revision 22327  Directory Listing
Modified Sat Aug 24 18:56:58 2013 UTC (4 years, 1 month ago) by alexy
BUG: Fixed gcc compile error. Removed redundant 'extension' argument

Revision 22326  Directory Listing
Modified Sat Aug 24 08:44:52 2013 UTC (4 years, 1 month ago) by lassoan
COMP: Fixed build error in vtkMRMLApplicationLogic

Revision 22325  Directory Listing
Modified Fri Aug 23 18:58:17 2013 UTC (4 years, 1 month ago) by alexy
BUG: 2816. Made data present in SceneViews to be stored in MRB file even if not present in the main scene.
 Restructured vtkMRMLApplicationLogic::SaveSceneToSlicerDataBundleDirectory() code, made it more modular.

Revision 22315  Directory Listing
Modified Fri Aug 23 00:32:53 2013 UTC (4 years, 1 month ago) by naucoin
ENH: Add the ability to access displayable managers.

Added get nth displayable manager to the displayable manager group, and
get displayable managers to the ThreeD view and widget
Useful for debugging displayable managers.

Revision 22313  Directory Listing
Modified Fri Aug 23 00:32:44 2013 UTC (4 years, 1 month ago) by naucoin
ENH: Move the color conversion utility methods

Move the C++ color / Qt color conversion methods out of
Annotations and into qMRMLUtils.

Revision 22312  Directory Listing
Modified Fri Aug 23 00:32:39 2013 UTC (4 years, 1 month ago) by naucoin
BUG: Set strings to null after delete

Set strings to null after they've been deleted, trying to
avoid seg faults when debugging

Revision 22311  Directory Listing
Modified Fri Aug 23 00:32:36 2013 UTC (4 years, 1 month ago) by naucoin
ENH: Add support for the LPS coordinate system for CLIs

Add a coordinate system flag check, default to ras but support LPS.

Update the displayable nodes that use the WriteCLI method to
use the coordinate system flag.

TODO: IJK coordinate system - See issue #2979

Revision 22310  Directory Listing
Modified Fri Aug 23 00:27:48 2013 UTC (4 years, 1 month ago) by naucoin
ENH: Re-factor selection node

Use the class name so modules can register a node to place
via mouse more generally.

Use the new functionality in the mouse mode tool bar,
annotations, testing.

Revision 22308  Directory Listing
Modified Thu Aug 22 05:08:31 2013 UTC (4 years, 1 month ago) by jcfr
BUG: Fix "transform file not marked as modified on save".

Call StorableModifiedTime in ProcessMRMLEvents() when the transform matrix is internally modified.
Fixes #3303

From: Yuzheng Zhou <yuzheng.zhou@kitware.com>

Revision 22298  Directory Listing
Modified Mon Aug 19 19:53:40 2013 UTC (4 years, 1 month ago) by jcfr
BUG: fix the misleading parameters in SetIJKToRASDirections.

Refactor setter methods SetIJKToRASDirections and fix its misleading parameters in vtkMRMLVolumeNode.
Fixes #3256

From: Yuzheng Zhou <yuzheng.zhou@kitware.com>

Revision 22297  Directory Listing
Modified Mon Aug 19 19:53:38 2013 UTC (4 years, 1 month ago) by jcfr
BUG: Fix "volume not marked as modified on save after harden transform".

Also, fix "annotations not marked as modified on save after they are changed" and "volume not marked as modified on save after volume origin or spacing is changed". Anytime a vtkMRMLStorableNode property that is saved in file is modified, the StorableModifiedTime time stamp must be modified.
Fixes #2980
Fixes #3246
Fixes #3260

From: Yuzheng Zhou <yuzheng.zhou@kitware.com>

Revision 22290  Directory Listing
Modified Fri Aug 16 15:10:48 2013 UTC (4 years, 1 month ago) by alexy
BUG: 3018. Fixed matrix multiplication order in vtkMRMLLinearTransformNode::ApplyTransformMatrix

Revision 22287  Directory Listing
Modified Thu Aug 15 14:30:52 2013 UTC (4 years, 1 month ago) by pieper
STYLE: fix compile warnings, unused variables, (un)signed, trailing spaces

Revision 22285  Directory Listing
Modified Tue Aug 13 18:52:04 2013 UTC (4 years, 1 month ago) by pieper
STYLE: fix warnings about signed/unsigned mismatches

Revision 22282  Directory Listing
Modified Fri Aug 9 19:50:53 2013 UTC (4 years, 1 month ago) by finetjul
BUG: Support volume origin and spacing larger than 100000

Issue #3010 @0009428

Revision 22280  Directory Listing
Modified Fri Aug 9 19:50:49 2013 UTC (4 years, 1 month ago) by finetjul
ENH: Apply units to Ruler node measurement labels

Issue #1694

Revision 22278  Directory Listing
Modified Fri Aug 9 19:50:43 2013 UTC (4 years, 1 month ago) by finetjul
ENH: Add coefficient and offset support in unit's settings and widgets.

Issue #1694

Revision 22276  Directory Listing
Modified Fri Aug 9 17:58:08 2013 UTC (4 years, 1 month ago) by alexy
ENH: added progress event to SeedStreamlinesInROI

Revision 22264  Directory Listing
Modified Tue Aug 6 20:15:01 2013 UTC (4 years, 1 month ago) by alexy
BUG: 1395. Fixed drawing of DTI glyphs on 2D slices. Display manger responds to proper events now.

Revision 22263  Directory Listing
Modified Tue Aug 6 18:07:40 2013 UTC (4 years, 1 month ago) by alexy
ENH: 2487. Added new method: void vtkMRMLHierarchyNode::MoveInParent(int increment)
Added tests for this method in vtkMRMLHierarchyNodeTest3.

Revision 22260  Directory Listing
Modified Tue Aug 6 13:43:58 2013 UTC (4 years, 1 month ago) by pieper
BUG: #2326 mark a node as modified if the name has changed

When the user has changed the name of a node this is
reflected in the suggested name of the file (see issue #3125).
With this fix the node is also marked as modified so that
it will be checked for saving.

This means that changing the name of a node in the scene will
cause it to be saved to a new file on disk which is a slight change
in behavior and may cause people to use more disk space.  But in
general I think this is safer and more clear, since file names will
always match the name of the node in the scene and users will
prefer that I believe.

Revision 22257  Directory Listing
Modified Fri Aug 2 23:14:12 2013 UTC (4 years, 1 month ago) by pieper
BUG: #3270 Slice Model is white in FA mode

Color scalar image modes were being treated differently with respect
to the image pipeline, meaning that the resulting texture image data was
5 component with a duplicated alpha channel (so it was RGBAA not RGBA).
Putting adding the ExtractComponents instance to the pipeline
took care of this.

Revision 22256  Directory Listing
Modified Fri Aug 2 20:26:42 2013 UTC (4 years, 1 month ago) by alexy
BUG: 2153. Fixed removal from members of DoubleArrayIDs inside iteration loop that caused crash.

Revision 22252  Directory Listing
Modified Wed Jul 31 21:47:41 2013 UTC (4 years, 1 month ago) by pieper
BUG: #3267 silence warning message

By changing the error message to a debug message we avoid signalling
an error condition when in fact it's not an error.

Revision 22251  Directory Listing
Modified Tue Jul 30 21:12:21 2013 UTC (4 years, 1 month ago) by hjohnson
ENH: Add stock un-altered version of the LUT

For 20120827 directly form freesurfer
The next patch set will modify this file for slicers purposes.

ENH: Modify for Slicer LUT conformance

s/^#/# /g  <-- Comment lines need a space after the #
s/0$/255/g <-- the alpha channel needs to be 255 in all cases except unknown
%s/\(nknown.* \)255$/\1 0/g   <-- unknowns need to be transparent

ENH: Change Default LUT to the 2012 freesurfer.

This addresses the issues in mantis ticket
http://www.na-mic.org/Bug/view.php?id=3238

Revision 22250  Directory Listing
Modified Tue Jul 30 20:57:29 2013 UTC (4 years, 1 month ago) by hjohnson
ENH: Add a version for the FreeSurferColorLUT_YYYMMDD.txt so that multiple versions can be available.

The first line of the FreeSurferColorLUT.txt file as provided from the freesurfer binary distributions contains a source code date-time stamp
that can be used to version the files unabiguously.

Revision 22248  Directory Listing
Modified Tue Jul 30 19:23:06 2013 UTC (4 years, 1 month ago) by pieper
BUG: #1930 ensure redraw after rotate to volume plane

Make sure matrices reflect current orientation of the slice
plane.

Revision 22247  Directory Listing
Modified Tue Jul 30 19:23:02 2013 UTC (4 years, 1 month ago) by pieper
STYLE: avoid warning a about narrowing 0.0 to int

Revision 22235  Directory Listing
Modified Thu Jul 25 20:33:00 2013 UTC (4 years, 2 months ago) by johan.andruejol
ENH: Custom style for slicer

Allow the slicer to use custom styles. This rests on the Qt style plugin
framework. The style plugins must be compiled with the same Qt as slicer,
in the same mode (debug, release...) and in shared library mode.
To facilitate the creation of new plugins, a cmake macro was added to
slicer cmake directory.
Every slicer style must inherits from qSlicerStyle. They are not detected
by the application otherwise.

The new styles can be set like modules. A setting page is added for them
where user can specify the directory containing his plugin. The additionnal
paths and the style key are added as settings. This means that the next
time slicer's session is opened, the application will automatically load
the custom style if it still exists.
Adding or removing paths necessit the application to be restarted. This
comes from the fact that the QStyleFactory is only updated upon its
creation which only happens when starting the application.
Changing the style however doesn't need to restart the application.
At this occasion, a Slicer dark style was added to the list of available
styles.

On the implementation side, the designer plugin export definition was
shortened and includes the "DESIGNER" term so it is different than the
style export macro.

Finaly, adding a fix to the slice controller widget label style so
it can work with the new dark style.

Revision 22234  Directory Listing
Modified Thu Jul 25 13:42:29 2013 UTC (4 years, 2 months ago) by jcfr
ENH: Add QuadBuffer stereo support

By default there is always an attempt to enable stereo capability. This is
done in ctkVTKAbstractViewPrivate::setupRendering [1].

Then, following the test done within the different implementation of
vtkRenderWindow, in case the hardware doesn't support it, the flag associated
with StereoCapability will be turned off [2][3].

Finally, the action within the threeD controller widget is enabled
or disabled based on the state of the StereoCapability flag.

[1] https://github.com/commontk/CTK/blob/4e98d9a064bfe32a4c0cb28838a093e392dc3cc3/Libs/Visualization/VTK/Widgets/ctkVTKAbstractView.cpp#L102
[2] https://github.com/Kitware/VTK/blob/0e0674a3695fdeaf01ce87dfc04e32111b7402e0/Rendering/vtkXOpenGLRenderWindow.cxx#L351-401
[3] https://github.com/Kitware/VTK/blob/0e0674a3695fdeaf01ce87dfc04e32111b7402e0/Rendering/vtkWin32OpenGLRenderWindow.cxx#L734-738

See http://www.na-mic.org/Bug/view.php?id=1578

Fixes #1578

Revision 22229  Directory Listing
Modified Mon Jul 22 20:39:04 2013 UTC (4 years, 2 months ago) by jcfr
ENH: Allow temporary directory to be accessible in MRML logics.

TemporaryPath is added to vtkMRMLApplicationLogic, so that the temporary directory can be directly accessible from MRML logics.

Also add associated tests

Fixes #2416

From: Yuzheng Zhou <yuzheng.zhou@kitware.com>

Revision 22227  Directory Listing
Modified Mon Jul 22 14:59:48 2013 UTC (4 years, 2 months ago) by jcfr
COMP: Fix unused variable warning in qMRMLSliderWidget

Revision 22223  Directory Listing
Modified Mon Jul 22 01:59:19 2013 UTC (4 years, 2 months ago) by finetjul
BUG: vtkMRMLNode::Reset() should trigger ModifiedEvent if needed

 * Remove the dangerous method
vtkMRMLNode::CopyWithSceneWithoutModifiedEvent():
 ** Modifying a node should never be silent, at least one ModifiedEvent
should be triggered.
 * Copying references should not be silent: ModifiedEvent and
NodeReference*Events should be triggered.

The fix ensures resetting() the selection node triggers at least 1
ModifiedEvent.

Fixes #3152

Revision 22217  Directory Listing
Modified Fri Jul 19 20:04:05 2013 UTC (4 years, 2 months ago) by pieper
BUG: #2326 Fix tests and ENH: refactor sample data

The bug refers to failures of the py_vtkITKArchetypeScalarReaderFile
and py_vtkITKArchetypeDiffusionTensorReaderFile tests after
commit [1].  These tests relied on a side-effect of downloading
the sample data in order to determine the file to load
data from, but this was not reliable since the data was in a temp
directory.   Now the tests request the download directly.

The enhancement is that the sample data module now supports the
concept of categories of sample data sources, such that modules
can register their sample data.  This way a version of slicer can
offer sample data appropriate for use with the particular extensions
that have been installed.

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=22162

Revision 22216  Directory Listing
Modified Fri Jul 19 12:44:03 2013 UTC (4 years, 2 months ago) by finetjul
ENH: Expose scrollTo() to qMRMLTreeView

So that other modules could conveniently use.

Revision 22214  Directory Listing
Modified Thu Jul 18 23:16:03 2013 UTC (4 years, 2 months ago) by finetjul
COMP: Fix compilation warnings with static char* reference strings

The warning:
vtkMRMLStorableNode.h:154: warning: the address of ‘vtkMRMLStorableNode::StorageNodeReferenceRole’ will always evaluate as ‘true’

When replacing char [] into char*, the new warning is:
/.../vtkMRMLStorableNode.cxx:27: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

When replacing char* by const char*, vtkGetStringMacro can't convert
from const char* to char*.

Revision 22213  Directory Listing
Modified Thu Jul 18 22:01:19 2013 UTC (4 years, 2 months ago) by finetjul
BUG: Block/Redirect display node events in CLI node writing

Closes #2966, #2915

Revision 22212  Directory Listing
Modified Thu Jul 18 22:01:16 2013 UTC (4 years, 2 months ago) by finetjul
BUG: Fix decimals in volumes module

Loading MRHEAD, we want the default coordinates to be:
 - spacing: 1.0, 1.0, 1.3
 - origin: -86.645, 133.929, 116.786 if the length unit precision is 3
Issues #2480, #2986, #3074...

Revision 22210  Directory Listing
Modified Thu Jul 18 14:00:36 2013 UTC (4 years, 2 months ago) by finetjul
ENH: Add write support for MRC files

Closes #1815

Revision 22206  Directory Listing
Modified Wed Jul 17 19:56:27 2013 UTC (4 years, 2 months ago) by naucoin
STYLE: add tool tips to the clipping widget

Explain what is meant by the clipping terms and positive/negative
spaces.

Issue #2560


Revision 22202  Directory Listing
Modified Tue Jul 16 19:54:42 2013 UTC (4 years, 2 months ago) by millerjv
BUG: #2739: Add configuration of two slice viewers

Added layout with just two slice viewers arranged side by side

Revision 22200  Directory Listing
Modified Tue Jul 16 17:35:47 2013 UTC (4 years, 2 months ago) by millerjv
BUG: #2788. Crosshairs change position on zoom (and pan)

Added OnSliceNodeModifiedEvent() to update the Crosshair display
position when SliceNode is modified, for instance by zooming or
panning.

Revision 22199  Directory Listing
Modified Tue Jul 16 13:22:09 2013 UTC (4 years, 2 months ago) by finetjul
STYLE: Initialize logics in ObserveMRMLScene instead of SetMRMLSceneInternal

Revision 22197  Directory Listing
Modified Mon Jul 15 15:41:11 2013 UTC (4 years, 2 months ago) by finetjul
STYLE: Improve robustness of vtkMRMLScalarVolumeDisplayNode

Setting back the DisableModifiedEvent to 0 could be dangerous if the
node ModifiedEvent was already disabled before ProcessMRMLEvents is called.

Revision 22196  Directory Listing
Modified Mon Jul 15 15:41:09 2013 UTC (4 years, 2 months ago) by finetjul
BUG: Fix random crash in CLI when writing in output volume node

itkMRMLIDImageIO::Write was triggering node events (such as
vtkMRMLVolumeNode::ImageDataModifiedEvent) in a thread other than
the main thread.
The solution is to catch those events before any observer is notified,
and reschedule those events in the main thread.

Closes #2915

Revision 22193  Directory Listing
Modified Mon Jul 15 15:24:47 2013 UTC (4 years, 2 months ago) by finetjul
BUG: Fix Volumes module decimals behavior

* make sure qMRMLVolumeInfoWidget gets setMRMLScene called before
the current volume node combobox. This is important because
qMRMLSliderWidget can change the number of decimals from the units node.
Such decimal number should be overwritten by the value of the spacing (or
origin).

Revision 22192  Directory Listing
Modified Mon Jul 15 15:24:37 2013 UTC (4 years, 2 months ago) by finetjul
ENH: Add vtkMRMLUnitNode::GetDisplayStringFromValue

Revision 22189  Directory Listing
Modified Mon Jul 15 15:24:11 2013 UTC (4 years, 2 months ago) by finetjul
BUG: Restore the selection node units on scene close

Re-enable Units module.
Closes #3176, #3152

Revision 22188  Directory Listing
Modified Mon Jul 15 15:24:02 2013 UTC (4 years, 2 months ago) by finetjul
ENH: Add support for node reference templates

In vtkMRMLSelectionNode, the exact name of the reference roles of a unit is
not known until the unit is set and observed. (it's a dynamic number of
unit reference roles). By using a special key '/' in the reference role
(e.g. "unit/"), it is possible to have multiple reference roles
(e.g. "unit/length", "unit/time"...).
Issue #2727

Revision 22187  Directory Listing
Modified Mon Jul 15 15:23:55 2013 UTC (4 years, 2 months ago) by finetjul
BUG: Copy NodeReferenceMRMLAttributeNames in vtkMRMLNode::Copy()

Issue #2727

Revision 22186  Directory Listing
Modified Mon Jul 15 15:23:48 2013 UTC (4 years, 2 months ago) by finetjul
STYLE: Use static member variables for reference roles and attribute name

Issue #2727

Revision 22184  Directory Listing
Modified Sat Jul 13 08:30:18 2013 UTC (4 years, 2 months ago) by jcfr
BUG: Fix TranslatorPlayer tests to account for ctkSpinBox renaming

Commit r22128 updated CTK to propagate renaming of ctkSpinBox
into ctkDoubleSpinBox, this commit also fixes the test that were
using ctkSpinBox.

Revision 22183  Directory Listing
Modified Sat Jul 13 08:13:16 2013 UTC (4 years, 2 months ago) by jcfr
BUG: Fix vtkMRMLCameraDisplayableManagerTest1

Following r22159 fixing issue #1798, the "useDepthPeeling" view node
property has been introduced, this commit updates the mrml input file
used by the test with this new property.

Related to #1798

Revision 22173  Directory Listing
Modified Fri Jul 12 23:11:19 2013 UTC (4 years, 2 months ago) by pohl
BUG: warning was displayed via vtkErrorMacro

Revision 22160  Directory Listing
Modified Tue Jul 9 14:19:06 2013 UTC (4 years, 2 months ago) by pieper
ENH: #1879 hotkeys to cycle through volumes

Added left/right bracked [ and ] to cycle through background layer
and left/right brace { and } to cycle through foreground layer.

Label layer is not included since labels can be seen in foreground
layer.

Also remove some trailing spaces for sytle purposes.

Revision 22159  Directory Listing
Modified Tue Jul 9 13:48:12 2013 UTC (4 years, 2 months ago) by finetjul
ENH: Add depth peeling option in 3D view controller

Closes #1798

Revision 22157  Directory Listing
Modified Tue Jul 9 12:41:24 2013 UTC (4 years, 2 months ago) by pieper
ENH: #1930 Don't scroll past edges of volumes

Now the arrow keys and mouse wheel events are clamped to the range
of the volumes in the z direction of the slice views like the view
controller's sliders are.  This prevents 'runaway' scrolling and losing
the slice.

Revision 22153  Directory Listing
Modified Mon Jul 8 20:29:07 2013 UTC (4 years, 2 months ago) by finetjul
BUG: Disable auto enabling for qMRMLCoordinatesWidget

The dimension coordinate widget in Volumes should stay disabled.

Revision 22152  Directory Listing
Modified Mon Jul 8 20:29:05 2013 UTC (4 years, 2 months ago) by finetjul
ENH: Add control over decimals in Transforms module

Closes #2480, #2579

Revision 22151  Directory Listing
Modified Mon Jul 8 20:29:02 2013 UTC (4 years, 2 months ago) by finetjul
ENH: Give user control over the number of decimals in spinboxes

Adding decimals is now possible in spinboxes.
Note that this work is orthogonal to units but not incompatible.
Closes #2973, #2986

Revision 22146  Directory Listing
Modified Mon Jul 8 12:59:57 2013 UTC (4 years, 2 months ago) by pieper
BUG: #3014 fix failing MRB condition where . was missing from extension

This is a follow on fix for r22143 to handle the case where the filename
already has the correct extension.  Before this fix a situation
could arise where the filename would be something like ".nrrdnrrd" and
so it would fail to save.  Now it is correctly saved as ".nrrd".

Revision 22143  Directory Listing
Modified Fri Jul 5 16:59:05 2013 UTC (4 years, 2 months ago) by pieper
BUG: #3014 fix databundle save/restore for dicom volumes

Fix a hole in the logic where a dicom volume would have a storage
node allocated, but the storage type would not be correctly defined
so the temp save path would not work.  Plus the default name
would be set to an invalid filename since dicom volume nodes
have a colon in the string by default.  Now these files are given
a default extension type (.nrrd for scalar volumes) and the names
are percent-encoded to avoid bad file name issues.

Revision 22142  Directory Listing
Modified Fri Jul 5 15:32:50 2013 UTC (4 years, 2 months ago) by pieper
BUG: #2990 use conventional layout if saved layout not available

When a module or extension creates a custom layout the number (say, 100)
is saved in the settings file and slicer tries to restore that
on the next start up.  However these layouts can be transient creations
and won't be available at startup.  This patch improves handling of
that case - rather than printing a warning and showing a blank screen, the
program now starts with the regular layout which leads to less
user confusion.

Revision 22139  Directory Listing
Modified Thu Jul 4 22:20:40 2013 UTC (4 years, 2 months ago) by finetjul
ENH: Disable scrolling everywhere there is an active scrollarea

Don't do it only for comboboxes.
Closes #1820, #1462

Revision 22137  Directory Listing
Modified Thu Jul 4 19:48:16 2013 UTC (4 years, 2 months ago) by finetjul
ENH: Redesign foreground and labelmap opacity slider layout

Closes r1821, r1563

Revision 22136  Directory Listing
Modified Thu Jul 4 14:51:17 2013 UTC (4 years, 2 months ago) by naucoin
ENH: add the ability to add custom actions and trigger them

Added a list of actions that are added after the default none,
add, remove, rename actions that the combo box supplies. When
the new action is selected, it is triggered so a module can
add a connection to listen for the triggered signal on the action
and activate a local slot.
Added a test to exercise trying to add duplicate or conflicting
actions.
Use the foreach construct to iterate over the user actions.
From development on new Markups module.


Revision 22135  Directory Listing
Modified Thu Jul 4 13:22:07 2013 UTC (4 years, 2 months ago) by finetjul
ENH: Don't scroll comboboxes that are inside a scroll area

Using the mouse in a scroll area could inadvertently change combobox
current index (on mouse over).
For conveniency, all the qMRMLNodeComboBoxes won't scroll in scrollarea by
default.
Closes #1820, #1462

Revision 22132  Directory Listing
Modified Wed Jul 3 21:43:46 2013 UTC (4 years, 2 months ago) by jcfr
STYLE: ITK_EXPORT had no use

The defintion of ITK_EXPORT was empty in all cases

This has been identified since 2003 as not being necessary
for builds. see https://issues.itk.org/jira/browse/ITK-3110

On Windows builds that need exports, they must
be unique per library, and that is not controlled by CMake now.

The PrintSelfCheck.tcl was the only remenant need for
This patch, and that is no longer being used, so that
file as been removed.

The ITK_EXPORT define was set to nothing and had no
known remaining purpose.  It was removed to make the
over all code easier to understand.  There was,
understandably, a bit of confusion about the
need for this being pervasive in the code.

It is currently backwards compatible to have
this in code, but at some future point it will
be removed.

From: Hans Johnson <hans-johnson@uiowa.edu>

Revision 22128  Directory Listing
Modified Fri Jun 28 22:49:43 2013 UTC (4 years, 2 months ago) by finetjul
COMP: Propagate CTK renaming: ctkSpinBox to ctkDoubleSpinBox

Revision 22113  Directory Listing
Modified Wed Jun 19 20:27:54 2013 UTC (4 years, 3 months ago) by finetjul
BUG: Improve vtkMRMLCommandLineModuleNode python wrapping

Python doesn't wrap enum type, making the SetStatus method unavailable
in the scripted module. Using an int instead fixes this.

Revision 22111  Directory Listing
Modified Wed Jun 19 20:27:40 2013 UTC (4 years, 3 months ago) by finetjul
BUG: Zombie display node when turning a volume into labelmap

When the current display node was removed, the slicer layer logic was
creating a new node and adding it into the scene.
Such node was not being removed of the scene when the new display node
was set.

Revision 22108  Directory Listing
Modified Wed Jun 19 19:58:21 2013 UTC (4 years, 3 months ago) by jcfr
BUG: Fix crash when saving data

Commit r22095[1] intended to disable "unit" functionality by
preventing the associated logic from being loaded.

This commit comments the "unit" code associated with the selection node
to fix crash happening when saving data.

See http://www.na-mic.org/Bug/view.php?id=3176
Fixes #3176

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=22095

Co-authored-by: Marine Clogenson <marine.clogenson@epfl.ch>

Revision 22089  Directory Listing
Modified Fri Jun 7 16:35:01 2013 UTC (4 years, 3 months ago) by alexy
BUG: 3148. Fixed crash on transform node reparenting

Revision 22088  Directory Listing
Modified Fri Jun 7 16:32:08 2013 UTC (4 years, 3 months ago) by alexy
BUG: 3133.  invoke TransformModifiedEvent when new TransformNode is set

Revision 22078  Directory Listing
Modified Tue Jun 4 21:51:27 2013 UTC (4 years, 3 months ago) by johan.andruejol
BUG: Delete unnecessary Q_ASSERT in unit aware widgets

These asserts were added with the slicer normal context of execution in
 mind. In this case a scene should have a selection node at all time.
However, in tests that is not the case. Since the code is already
acounting for the fact that there might not be a selection node
(see updateWidgetFromUnitNode()), the asserts can just be removed.

See Issue #3143

Revision 22075  Directory Listing
Modified Tue Jun 4 19:31:29 2013 UTC (4 years, 3 months ago) by johan.andruejol
BUG: Fix MRMLScene import and export

In the selection node, the unit didn't add a
NodeReferenceMRMLAttributeNames for each of its reference role. These
attributes are used when saving the mrml scene to describe what the
reference role is used for. Most notably, this can be used when importing
a scene.
However, since there wasn't any defined for the selection node, a saved
scene would look like this:
 ... selected="false" ="vtkMRMLUnitNodeApplicationLength" "vtkMRMLUnitNodeApplicationTime" activeVolumeID="NULL" ...
Which is an invalid format for the scene.

Adding a NodeReferenceMRMLAttributeNames is usually done in the class
constructor. In our case, we assume that we don't know what kind of unit
quantity can be added. Thus we don't know the ReferenceRoles we will need
at constructor time. So we add theses roles in the SetUnitNodeID().
The roles names are based on the quantity, and aren't actually used
anywhere.

To make sure this works, a test opening Slicer, saving a scene and loading
it again is added.

See Issue #3145

Revision 22073  Directory Listing
Modified Tue Jun 4 15:14:06 2013 UTC (4 years, 3 months ago) by alexy
BUG: 3141. Added heck for NULL LUT.

Revision 22072  Directory Listing
Modified Mon Jun 3 19:45:21 2013 UTC (4 years, 3 months ago) by johan.andruejol
BUG: Ensure backward compatibility in qMRMLNodeComboBox

Here is a quick summary of what happened:

What changed in r22052:
 Rename the Q_Property from currentNodeId to currentNodeID
 Rename QString currentNodeId() to QString currentNodeID()
 Rename setCurrentNode(const QString nodeID)
  to setCurrentNodeID(const QString nodeID)

What changed in r22059:
 Add QString currentNodeId() as a deprecated function
  (not invokable though)

What is broken after r22052 and r22059 ?:
 In C++, the function setCurrentNode(const QString nodeID) is missing.
 In Python:
  The function currentNodeId() is missing (not wrapped due to a missing
   Q_INVOKABLE).
  Trickier, any code using the property currentNodeId = ... will break too.

What this commit intend to fix:
  Add Q_INVOKABLE to currentNodeId() method for python wrapping.
  Return the old property as deprecated.

Also adding warning in the deprecated function to warn other developers.

See Issue #1694

Revision 22061  Directory Listing
Modified Wed May 29 21:44:39 2013 UTC (4 years, 3 months ago) by johan.andruejol
BUG: vtkMRMLUnitNodeTest1 use size_t instead of int

This fixes the warnings for linux brought by r22053

  /Slicer-TR/Libs/MRML/Core/Testing/vtkMRMLUnitNodeTest1.cxx: In function ‘bool TestScenesUnitNodeID(vtkMRMLScene*)’:
  /Slicer-TR/Libs/MRML/Core/Testing/vtkMRMLUnitNodeTest1.cxx:86: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  /Slicer-TR/Libs/MRML/Core/Testing/vtkMRMLUnitNodeTest1.cxx:92: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  /Slicer-TR/Libs/MRML/Core/Testing/vtkMRMLUnitNodeTest1.cxx: In function ‘bool TestUnitNodeAttribute(vtkMRMLScene*)’:
  /Slicer-TR/Libs/MRML/Core/Testing/vtkMRMLUnitNodeTest1.cxx:121: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

And the same kind of warning in the logic test.

See Issue #1694

Revision 22060  Directory Listing
Modified Wed May 29 19:08:49 2013 UTC (4 years, 3 months ago) by jcfr
BUG: Fix compile error related to "WrapValue" unit methods

Following commit r22055 [1], three new methods have been introduced:
- WrapValueWithPrefix
- WrapValueWithSuffix
- WrapValueWithPrefixAndSuffix

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=22055

This was causing a build error on linux:

 In member function ‘std::string vtkMRMLUnitNode::WrapValueWithPrefixAndSuffix(std::string&)’:
 ../vtkMRMLUnitNode.cxx:183: error: no matching function for call to ‘vtkMRMLUnitNode::WrapValueWithPrefix(std::string)’
 ../vtkMRMLUnitNode.cxx:159: note: candidates are: std::string vtkMRMLUnitNode::WrapValueWithPrefix(std::string&)

Making the method const correct fixed the problem.

More details about the error are reported here: http://stackoverflow.com/questions/1565600/how-come-a-non-const-reference-cannot-bind-to-a-temporary-object

Revision 22059  Directory Listing
Modified Wed May 29 18:08:00 2013 UTC (4 years, 3 months ago) by johan.andruejol
ENH: Add currentNodeId() as a deprecated method

This will falicitate the transition for extensions and projects depending
on Slicer.

See Issue #1694

Revision 22056  Directory Listing
Modified Wed May 29 16:53:59 2013 UTC (4 years, 3 months ago) by johan.andruejol
ENH: Only one unit per quantity accessible to the user

Now only one unit per quantity is accessible to the user. This unit can
be customized and it's logged in the settings so it can be restored
when opening the application.
On the implementation side of things:
- Add access method to all the referenced unit nodes in the selection node
- Remove the unit widget
- Hide module
- Create the unit widget to easily customize units (add the plugins with
it)
- Create the unit settings widget using the unit widget. This widget
is tailored to be used in the setting panel (no plugin)
- Refactorize the setting panel to use the setting unit widget and
log the unit node properties
- Create only node for each quantity exposed to the user. The preset nodes
are kept in a special scene in the logic.

See Issue #1694

Revision 22055  Directory Listing
Modified Wed May 29 16:53:44 2013 UTC (4 years, 3 months ago) by johan.andruejol
ENH: Apply units widget to slicer

Modified:
- Volume info widget: Made it a qMRMLWidget so it can propagate the
mrml scene.
- Annotations: Add to vtk widget and GUI
- Tractography Interactive seeding: Add units to GUI
- Slice controller: add units in spinboxes
- Volumes: add units to GUI
- Editor: add units to paint and island effects

See Issue #1694

Revision 22054  Directory Listing
Modified Wed May 29 16:53:27 2013 UTC (4 years, 3 months ago) by johan.andruejol
ENH: Add Unit compatible widget

Added new widgets that can observes the MRML scene to deduce the
current unit for a quantity type (the singleton vtkMRMLSelectionNode is
used for storage in this case).

See Issue #1694

Revision 22053  Directory Listing
Modified Wed May 29 16:53:18 2013 UTC (4 years, 3 months ago) by johan.andruejol
ENH: Add Units module

The unit module handle the unit in slicer. The units are singleton in the
scene that belong to a quantity. So far the only quantity available are
length and time. The units are settings saved with the application.

See Issue #1694

Revision 22052  Directory Listing
Modified Wed May 29 16:53:05 2013 UTC (4 years, 3 months ago) by johan.andruejol
ENH: Harmonize qMRMLNodeComboBox properties

Previously, the property currentNodeId of the node combobox was set with an
id (QString) and sent a signal with a node (vtkMRMLNode*) which can be
confusing in the widgets using it. Now, the node combobox as an id
property or a node property.

See Issue #1694

Revision 22051  Directory Listing
Modified Wed May 29 14:16:01 2013 UTC (4 years, 3 months ago) by inorton
COMP: typo in patch provided for 22047, should be greater-or-equal

Revision 22047  Directory Listing
Modified Wed May 29 04:22:23 2013 UTC (4 years, 3 months ago) by jcfr
COMP: Fix msvc 2012 build error in vtkMRMLAbstractDisplayableManager

From: Isaiah Norton <isaiah.norton@gmail.com>

Revision 22014  Directory Listing
Modified Fri May 17 22:05:02 2013 UTC (4 years, 4 months ago) by jcfr
COMP: On MacOSX, do not create duplicate of MRMLIDIOPlugin and MGHIOPlugin

This fix MacOSX warning "/path/to/plugin is already loaded"

Both MRMLIDIOPlugin and MGHIOPlugin were copied so that it exists both
a "dylib" and a "so" version of the file. This was initially committed
on the 2007-09-27 to work around a limitation of ITK preventing it from
loading plugin having ".dylib" extension. See Slicer3 r4454 [1]

Then 2 months later, on the 2007-11-19, a fix has been pushed in ITK so
that plugin having extension "dylib" are considered. See ITK commit 28b4a6ba [2]

This commit account for the ITK fix by removing the code in charge of
copying the plugin.

Lessons learned: When implementing a hack, it is a good practice to report
a bug upstream to track the limitation and also reference the bug in a
comment starting with either "# HACK" for CMake file or "// HACK" for
c/cpp files. It would give a hint to developer re-factoring the code.

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer3?view=revision&revision=4454
[2] https://github.com/Kitware/ITK/commit/28b4a6ba

Revision 22010  Directory Listing
Modified Fri May 17 12:46:50 2013 UTC (4 years, 4 months ago) by alexy
ENH: added mode for enabling/disabling Fiber editing in TractographyDisplay module and vtkMRMLTractographyDisplayDisplayableManager

Revision 22006  Directory Listing
Modified Thu May 16 19:02:54 2013 UTC (4 years, 4 months ago) by alexy
BUG: 2528. Fixed the cause of the crash because of invalid LUT in vtkMRMLDiffusionTensorDisplayPropertiesNode

Revision 22001  Directory Listing
Modified Thu May 16 02:57:54 2013 UTC (4 years, 4 months ago) by jcfr
COMP: Fix qMRMLDisplayNodeWidgetEventTranslatorPlayerTest1

Following r21905, the widget UI has been re-organized. The XML file
has been updated to account for the change previously introduced.

Revision 21988  Directory Listing
Modified Tue May 14 18:13:59 2013 UTC (4 years, 4 months ago) by naucoin
BUG: copy opacity when creating a copy of a color node

The MRML color logic was using the the color node copy 
method that just copied the name and rgb, switched it 
to use the one that also copies opacity. 
Expanded the testing to exercise the copy and test the 
results.

Issue #3114

Revision 21986  Directory Listing
Modified Tue May 14 15:18:05 2013 UTC (4 years, 4 months ago) by alexy
ENH: added ability to interactively remove fiber lines.

Revision 21985  Directory Listing
Modified Mon May 13 15:44:28 2013 UTC (4 years, 4 months ago) by jcfr
COMP: Fix sign comparison warning

Revision 21984  Directory Listing
Modified Mon May 13 15:44:26 2013 UTC (4 years, 4 months ago) by jcfr
COMP: Fix unused variable warnings

Revision 21982  Directory Listing
Modified Sat May 11 17:09:18 2013 UTC (4 years, 4 months ago) by hjohnson
ENH: Code cleanup of the itkMGHImageIO

The itkMGHImageIO is a nice ITKv4 compliant IO mechanism that
would better serve a larger user community by becoming a
'Remote Module' that is part of ITKv4 proper.

The intent would be that if itkMGHImageIO became a part of ITKv4,
it could be removed from Slicer and built as part of ITKv4 and that
would make it available to stand-alone versions of SimpleITK, BRAINSTools,
ANTS, and other tools.  This would benefit generating stand-alone
processing tools that share capabilities from Slicer.

Revision 21981  Directory Listing
Modified Sat May 11 17:09:16 2013 UTC (4 years, 4 months ago) by hjohnson
ENH: Format with ITKv4 Style

Reformatting this code to follow the ITKv4 style.
This is a first step to evaluating if this may be
included as a Remote module in ITKv4 nightly testing
and downloads.

Revision 21979  Directory Listing
Modified Fri May 10 16:11:33 2013 UTC (4 years, 4 months ago) by alexy
BUG: 3112. Fixed Node Reference update for the case when observed events change.

Revision 21976  Directory Listing
Modified Thu May 9 13:11:39 2013 UTC (4 years, 4 months ago) by pieper
BUG: #2999 Snap to center of pixels when loading volumes

As described in bug report, centering the view to the center