BUG: figured out why transitioning to SpatialAtlas Step takes so long when loading the FullParcellation task and removed bug when setting atlas or subparcellation to None - it was not saved in mrml

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21807 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: not all of CSF was part of the sub atlas

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21808 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: expose qMRMLCheckableNodeComboBox methods to python

Per request from Kostro Daniel on slicer-dev list.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21809 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: 2727. Implemented new generic MRML node reference API in the vtkMRMLNode class. Implemented vtkMRMLDisplayableNode, vtkMRMLStorableNode, vtkMRMLTransformNode node using new API. Added tests to Libs/MRML/Core/Testing/vtkMRMLNodeTest1.cxx. See below for more details on the API.

== Goal ==
This page explains how to create a MRML node that reference and observes
other MRML nodes.

== History ==
In Slicer4.2 prior to March of 2013 each MRML node that contained
references to other MRML nodes (for example each vtkMRMLDispalyableNode contained
a reference to an instance vtkMRMLDisplayNode) was responsible for
managing the references internally. This involved complicated logic and
bookkeeping to maintain the references in sync when importing scenes,
adding/deleting nodes, modifying referenced nodes, etc.

When creating a new node with the reference to another node the following
methods needed to be created/updated to handle the references:


* Copy
* PrintSelf
* ReadXMLAttributes
* WriteXML
* ProcessMRMLEvents
* UpdateReferenceIS
* SetSceneRefeecnes
* UpdateScene
* UpdateReferences
* SetAndObserveReferenedNode

== New API ==
The new node reference API automatically takes care of read/write/copy of
node references, updating references on scene import, adding and deleting
nodes. All that functionality in implemented the vtkMRMLNode base
class. The only thing that needs to happen in the derived MRML node class
(usually in the constructor of the class)
is a call to vtkMRMLNode::AddNodeReferenceRole(const char *referenceRole,
const char *mrmlAttributeName)
that takes a unique string defining the reference role between this node
and the referenced node, and a MRML attribute name for storing the
reference in the .mrml file.

The only other call that is needed is either:
vtkMRMLNode* SetAndObserveNodeReferenceID(const char* referenceRole , const
char* referencedNodeID, vtkIntArray *events=0);
or 
vtkMRMLNode* AddAndObserveNodeReferenceID(const char* referenceRole , const
char* referencedNodeID, vtkIntArray *events=0);
if the multiple instances of this reference are allowed.

vtkMRMLNode also provides virtual callbacks that can be extended in the
derived calsses:
* OnNodeReferenceAdded(vtkMRMLNodeReference *reference)
* OnNodeReferenceRemoved(vtkMRMLNodeReference *reference)
* OnNodeReferenceModified(vtkMRMLNodeReference *reference)

By default those methods generate the following events:
* vtkMRMLNode::ReferenceAddedEvent
* vtkMRMLNode::ReferenceRemovedEvent
* vtkMRMLNode::ReferenceModifiedEvent

In the derived classes those methods could be extended using vtkMRMLNode
API that allows querying of node's references:

* char *GetNthNodeReferenceID(const char* referenceRole, int n);
* vtkMRMLNode* GetNthNodeReference(const char* referenceRole, int n);
* int GetNumberOfNodeReferences(const char* referenceRole);
* etc.

For full API see:

http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Libs/MRML/Core/vtkMRMLNode.h?view=log

Currently the following MRML nodes are implemented using new API:
* vtkMRMLStorableNode
* vtkMRMLTransformableNode
* vtkMRMLDisplayableNode

Other references to MRML nodes such as to vtkMRMLColorTableNode, vtkMRMLDiffusionTensorDisplayPropertiesNode are currently not using new API.

Module parameter nodes that contain references to input/output Volume/Model, etc. nodes may or may not require a new API since not all of them contain logic to deal with reference changes.

== Examples ==
* vtkMRMLTransformableNode implementation:
http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Libs/MRML/Core/vtkMRMLTransformableNode.h?view=log
* vtkMRMLDisplayableNodeimplementation:
http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Libs/MRML/Core/vtkMRMLDisplayableNode.h?view=log
* vtkMRMLStorableNodeimplementation:
http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Libs/MRML/Core/vtkMRMLStorableNode.h?view=log


git-svn-id: http://svn.slicer.org/Slicer4/trunk@21810 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Added a module to select tracts using labelmaps

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21811 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Corrected bug introduced due to interface change

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21812 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Moved the DTIimport/export modules to the legacy menu as the support for Nifti is now in the main slicer code

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21813 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Moved the FiberBundleToLabelMap module to Diffusion->Tractography

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21814 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Made naming of new modules more coherent

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21815 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Fixed compatibility with VS problems in my previous commit

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21816 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: clean up misleading warning

No need to warn that the directory is being deleted.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21817 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: expose qMRMLUtils for use from python

Make it a QObject for wrapping purposes.

Also: STYLE: remove trailing whitespace

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21818 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: make a comment into a docstring

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21819 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: editor eyedropper, eraser toggle, and related (issue #2928)

This adds the framework for other requested hotkeys.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21820 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: improve QImage to vtkImageData converter

Make sure the image is in rgb or argb format before converting,
and use pointer arithmetic to speed up the converter.

Add comment that we should consider using memcpy - this significantly
speeds up the conversion, but may not be correct across platforms.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21821 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: mark/remove unused variables, fix signed/unsigned comparisons

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21822 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Added methods enabling screenshot based testing

1. Added a new qSlicerCoreTestingUtility class that derives from
ctkQtTestingUtility and defines image comparison methods based on
vtkTesting.
2. Added functionality in ctkScreenshotDialog to control output
resolution of screenshot taken.
3. Added a new menu item under Edit menu in the Slicer app for saving a
test screenshot. This item invokes ctkScreenshotDialog with constrained
output resolution of 300x300.
ENH: Image compare to QWidget and transition to qSlicerCoreTestingUtility
Added slicer_add_qttest macro for automated testing

Added additional api to launcher options required for screenshot based
QtTesting. Addresses issue 2567.
BUG: Fixed minor issues with screenshot based testing

Added support for list of test scripts given to macro slicer_add_qttest
Slicer was closing prematurely as superclass method was called before
derived class method. (HandleCommandLineArguments)
Using qMRMLUtils method for converting from qImage to vtkImageData.