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.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23454 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Update MRMLIDImageIO - Add comment line separator

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

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

[...]

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

[...]

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

[...]

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

[...]

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

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