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.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22328 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Editing laodable names in DICOM widget can now lead to renaming of
the loaded loadables.

Closes #3284

From: Alireza Mehrtash <mehrtash@bwh.harvard.edu>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22329 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: #3284 don't let user edit some dicom fields

As of r22329 the name of the volume can be set via the table widget,
but editing the other fields makes no sense, so we disable it.

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


git-svn-id: http://svn.slicer.org/Slicer4/trunk@22331 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: confirm delete of markups

Add a message box to tell the user how many markups they
are about to delete and let them cancel. Option to
not show the message again.

COMP: cleaned up unused variable warnings

Fixes issue #3324



git-svn-id: http://svn.slicer.org/Slicer4/trunk@22332 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: remove fiducial settings from the tutorial self test GUI

Remove left over code from copying the add many fiducials self test.
Replaced them with screen shot parameters to help with making the tutorial,
a check box to turn them on (off by default) and a slider to set the scale
(1 by default).
Tweaked the test: make sure that the fiducial list is named the same
as when a user would create one. Make the slices visible in 3D.

Issue #3328



git-svn-id: http://svn.slicer.org/Slicer4/trunk@22333 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: #3315 allow editor extensions to define custom cursor

The mechanism for editor extensions to declare their cursor had
already existed, but it was being ignored.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22334 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix serialization of display node representation property

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22335 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Exposes RepresentationType and InterpolationType enums to python

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22336 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Consider specific file writer before generic one.

Ideally the file reader/writer should be reworked to have a more
consistent API. More specifically after the user select a file type
in the "save dialog", the corresponding "file writer id" should be
passed down the qSlicerCoreIOManager::saveScene/saveNodes methods.

This would prevent confusion for the user. Indeed, if a writer fails a
clear error message would be displated and the system wouldn't try an other
possible writer.

See issue #3322

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22337 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Add qSlicerScriptedFileWriter interface

User can now register python based file writer.

For example:

# File MyCustomSceneExporter.py

import json
import os
import zipfile
import contextlib
import datetime
import vtk, slicer

class MyCustomSceneExporter:
  def __init__(self, parent):
    parent.title = "[...]"
    parent.categories = ["..."]
    parent.dependencies = []
    parent.contributors = ["..."]
    parent.helpText = """[...]"""
    parent.acknowledgementText = """[...]"""
    self.parent = parent

class MyCustomSceneExporterFileWriter:
    def __init__(self, parent):
        self.parent = parent

    def description(self):
        return 'Custom Scene File'

    def fileType(self):
        return 'SceneFile'

    def canWriteObject(self, obj):
        return isinstance(obj, slicer.vtkMRMLScene)

    def extensions(self, obj):
        return ['CustomScene File (*.customscene.zip)']

    def write(self, properties):
        self.exportModels(properties['fileName'])
        return True

    [...]

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22338 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: stop the dropping of fiducials dragged outside of 2d viewport

Check if the viewport coordinates have been restricted as well as if the display
coordinates were changed, as the second check wasn't fine grained enough
to detect when a restriction was made on a slow/small drag outside
of the viewport. This would lead to the fiducial being dropped
when it was outside the viewport.
Now the fiducial is stopped at the edge of the 2d viewport. When the
mouse comes back toward the view port, there is an offset between the
mouse position and the moving fiducial, but barring more user feedback,
we decided to leave this as is.

Issue #3318


git-svn-id: http://svn.slicer.org/Slicer4/trunk@22339 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: remove debugging print out, fix doc category

Remove a qDebug call that is just informational about
the system settings for the markups.
Change the documentation category to Informatics.

Issue #2740



git-svn-id: http://svn.slicer.org/Slicer4/trunk@22340 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Fix authorship of qSlicerScriptedFileWriter

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22341 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Add macro "slicerMacroBuildLoadableModule"

Both macros "slicerMacroBuildQtModule" and "slicerMacroBuildLoadableModule"
can be used. At this point, no warning message is displayed if the
deprecated macro is used.

Fixes #2648

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

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


git-svn-id: http://svn.slicer.org/Slicer4/trunk@22344 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Hide initialization info when running Slicer as python interpreter.

Add method "qSlicerCoreCommandOptions::verbos" currently returning false
only  if slicer runs a python script directly passed as a command line
argument.

Later on, the system could be extended so that all initialization
information are hidden by default. They would be displayed
only if --verbose is explicitly passed.

Fixes #3285

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22345 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: fix extent check to accommodate single-slice data

No plots were shown correctly when extent range was 0 in one of the dimensions


git-svn-id: http://svn.slicer.org/Slicer4/trunk@22346 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix opening of link in extension manager

Opening of links different from slicer.kitware.com host into regular
browser has been initially introduced by r21897. Then, when commit r22220
introduced qSlicerWebWidget, the management of external links has been
broken.

This commit fixes the issue by ensuring the qSlicerWebWidget always open
link within its associated webview. The slot "onLinkClicked" from
"qSlicerExtensionsInstallWidget" will check what is the host and open
into a regular browser if needed.

See #3045

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