ENH: Improve readability re-organizing code in vtkMRMLVolumeArchetypeStorageNode::ReadDataInternal

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20553 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Simplify code - vtkSmartPointer do not have to be explicitly set to NULL

From VTK documentation:

  vtkSmartPointer() => Initialize smart pointer to NULL.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20554 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Simplify and refactor code in vtkSlicerVolumesLogic::AddArchetypeVolume

Create the struct ArchetypeVolumeNodeSet having pointers to
a Node, a DisplayNode and a Scene.

Code in charge of setting up the different nodes has been factored
out into function like:
  SetupDiffusionWeightedVolumeNodeSet
  SetupDiffusionTensorVolumeNodeSet
  [...]
  SetupScalarVolumeNodeSet

The function AddArchetypeVolume will now try to read data iterating
through a vector of NodeSetsItem. A node nodeSetsItem is a composed
of both a pointer to a storage node and a ArchetypeVolumeNodeSet.

The different steps associated with the AddArchetypeVolume function can
now be clearly identified:
 1) Process loading options
 2) Initialization of the I/O mechanisms
 3) Compute volume name
 4) Initialize NodeSetsItem vector
 5) Iterate over NodeSetsItem and try to read data
 6) Remove unused data
 7) Set and observe color node

See #2268 / http://www.na-mic.org/Bug/view.php?id=2268

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20555 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: More robust vtkSlicerVolumesLogic::IsFreeSurferVolume

Check for NULL filename

See #2268 / http://www.na-mic.org/Bug/view.php?id=2268

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20556 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Simplify TranslateFreeSurferRegistrationMatrixIntoSlicerRASTo by using vtkNew

See #2268 / http://www.na-mic.org/Bug/view.php?id=2268

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20557 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Simplify vtkSlicerVolumesLogic::CloneVolume using smart pointer

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20558 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Simplify vtkSlicerVolumesLogic::FillLabelVolumeFromTemplate using smart pointer

See #2268 / http://www.na-mic.org/Bug/view.php?id=2268

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20559 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Simplify vtkSlicerVolumesLogic::CreateLabelVolume using smart pointer

Also ensure that input parameters are all valid

See #2268 / http://www.na-mic.org/Bug/view.php?id=2268

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20560 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Update doxygen comment of vtkSlicerVolumesLogic to new style

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20561 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Add convenient function CloneVolume that use the current scene

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20562 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Add convenient function FillLabelVolumeFromTemplate that use the current scene

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20563 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Add convenient function CreateLabelVolume that use the current scene

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20564 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Remove extra call to Modified() function in SetActiveVolumeNode

Macro "vtkSetMRMLNodeMacro" already takes care of calling "Modified()"
if required.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20565 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Display volume loading error only when it makes sens

Created  a class named "vtkSlicerErrorSink" allowing to keep track
of error messages. These messages are either discarded if the volume
was successfully loaded. If the volume could not be loaded using the
available reader, error will be displayed.

It will probably make sens to either move that class into MRML/Core or
VTK proper vtkSlicerErrorSink. Before doing so, few iteration will be
needed to improve the associated API.

See http://www.na-mic.org/Bug/view.php?id=2268

Fixes #2268

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