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


git-svn-id: http://svn.slicer.org/Slicer4/trunk@23148 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Added missing vtkOrientedBSplineTransform files

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23149 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Avoid unnecessary recompilation on MacOSX. Fixes #2583

This has been discussed with the CMake folks. A small example [1]
allowing to reproduce the problem has been provided and the solution is
to use the option "CMAKE_BUILD_WITH_INSTALL_RPATH" to build the
python project.

Note that this fix is not required for zlib and curl project because the
associated library is built statically and is not updated at install
time.

8<----8<----8<----8<----8<----8<----8<----8<----8<----
From Brad King - April 24, 2014:
It's due to the install_name_tool used to update the binary
on installation. The cmake_install.cmake file contains:

    execute_process(COMMAND "/usr/bin/install_name_tool"
      -id "libfoo.dylib"
      "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libfoo.dylib")

If you build with -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON then
no install-time update will occur.
8<----8<----8<----8<----8<----8<----8<----8<----8<----

[1] https://gist.github.com/jcfr/11233992

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23150 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Fixed vtkOrientedBSplineTransform build with VTK6

Also added test for single-precision point transform computation in vtkOrientedBSplineTransform.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23151 3bd1e089-480b-0410-8dfb-8563597acbee
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.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23152 3bd1e089-480b-0410-8dfb-8563597acbee
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)

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23153 3bd1e089-480b-0410-8dfb-8563597acbee
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};

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23154 3bd1e089-480b-0410-8dfb-8563597acbee
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]

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23155 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Fixed linux warnings


git-svn-id: http://svn.slicer.org/Slicer4/trunk@23156 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Associate component with all install rules.

Related to #2397

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23157 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Reduce package size by not installing export libraries. Fixes #2397

This commit explicitly installs the needed component and skips the
development component if not explicitly requested.

Since on DLL platform, export libraries (.lib) are considered as archive [1]
and are associated with the development component, they won't be installed
in the package.

[1] http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:install

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23158 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Restore color image support in OpenIGTLinkIF. Fixes #3685

From: Junichi Tokuda <tokuda@bwh.harvard.edu>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23159 3bd1e089-480b-0410-8dfb-8563597acbee
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

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23160 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: remove unused variable warnings

Remove unused variables or mark as unused parameters
in the scene views module update.

Issue #1299



git-svn-id: http://svn.slicer.org/Slicer4/trunk@23161 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: GIT_WC_INFO with date support for git only repository

To allow the date to be extracted from git only repository, the macro
"GIT_WC_INFO" has been extended to extract the commit date of the last
change.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23162 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Associate extension package name with the date of the last commit.

A similar problem was occurring while building the Slicer core and has
been fixed by r20028[1]. The associated issues were #1974 [2] and #1973 [3].

This commit associate to the package name the date of the latest commit
associated with the extension source repository. In case no repository
has been associated with the extension, the date "0000-00-00" will be
considered.

Thanks to "Chenxi Zhang <chenxizhang@fudan.edu.cn>" for reporting the
problem.

Associated discussion: http://slicer-devel.65872.n3.nabble.com/Problem-in-building-a-extension-tp4029816p4029857.html

Fixes #3356

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=20028
[2] http://www.na-mic.org/Bug/view.php?id=1973
[3] http://www.na-mic.org/Bug/view.php?id=1974

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23163 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Fix build errors with VTK6

Fix two minor compile errors in VTK6 conditional branch of
qSlicerSceneViewsModuleWidget, that were introduced in r23160.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23164 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Remove non-existing qrc reference

Remove odd relative path reference to a .qrc file in a ".designer"
directory, that is not part of the repository and likely does not exist
on most machines.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23165 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Initial work refactoring extension manager

After a losing battle trying to make the tree widget not use half the
space for the buttons, replace it with a list widget. Change the buttons
to have a stacked layout without enforced horizontal size, which gives
much more space to the extension text, add some padding so the icons
aren't so tight against each other, and increase the font size of the
extension name. Also, replace the random clipart icons with our own.

NOTE: Minimum size for the list items is not working correctly at the
moment. The text rendering needs some additional refactoring in order to
provide a correct minimum size, and a size hint needs to be set
explicitly on the list items.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23166 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix extension manager item sizing

Refactor qSlicerExtensionsDescriptionLabel to manage the text internally
as our own QTextDocument instance, and to do the painting ourselves.
This gives us greater control over the painting with less work, and
greatly simplifies producing a correct size hint, since we can just ask
the document for its size and get a correct answer regardless of
formatting, rather than trying to compute it ourselves from font
metrics. Now that we have a reasonable size hint, also use it to set the
item size hint, which ensures that the items are sufficiently tall e.g.
in case of the extra text line when an extension is incompatible.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23167 3bd1e089-480b-0410-8dfb-8563597acbee