Slicer merge requestshttps://gitlab.kitware.com/sjh26/Slicer/-/merge_requests2019-03-13T11:49:53-04:00https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1107STYLE: Replace ITK_OVERRIDE with override2019-03-13T11:49:53-04:00phcerdanSTYLE: Replace ITK_OVERRIDE with overrideThis commit replaces occurences of the ITK_OVERRIDE macro with override. This one-liner
was used to perform the update:
```
git grep -l "ITK_OVERRIDE" | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e "s/ITK_OVERRIDE/...This commit replaces occurences of the ITK_OVERRIDE macro with override. This one-liner
was used to perform the update:
```
git grep -l "ITK_OVERRIDE" | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e "s/ITK_OVERRIDE/override/g"
```
It was adapted from https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.shhttps://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1111ENH: Modernize: add override in virtual functions of derived classes2019-03-13T23:08:24-04:00phcerdanENH: Modernize: add override in virtual functions of derived classesAfter ITK_OVERRIDE and VTK_OVERRIDE have been replaced for `override`
we run clang-tidy to add overrides on virtual functions of derived
classes.
Example:
```diff
-virtual void ShowProgress()
+void ShowProgress() override
```
...After ITK_OVERRIDE and VTK_OVERRIDE have been replaced for `override`
we run clang-tidy to add overrides on virtual functions of derived
classes.
Example:
```diff
-virtual void ShowProgress()
+void ShowProgress() override
```
This allows compiler warnings and errors if the method
does not override the base class after a change in the base class.
Check the Slicer Wiki for an updated version of the documentation on
how to run clang-tidy.
https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide#C.2B.2B11:_Update_source_code_to_use_override
```
run-clang-tidy.py -checks=-*,modernize-use-override -header-filter=.* -fix
```
Multiple `override` are added to the same method.
```cpp
void PrintSelf(ostream& os, vtkIndent indent) override override override;
```
Clean them with (15 here is just a high enough number):
```
for n in `seq 1 15`;
do
ack "override override" -l --print0 | xargs -0 -n 1 sed -i \
's/override override/override/g'
done
```
When all of them are fixed, you should see in the terminal:
```
sed: no input files
```
This branch includes #1109 and #1107 (VTK_OVERRIDE and ITK_OVERRIDE)
https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1112STYLE: Remove outdated Qt4 code in CMake and python code.2019-03-13T23:38:29-04:00phcerdanSTYLE: Remove outdated Qt4 code in CMake and python code.Removed code was never executed since Qt5 is now required
or contained outdated documentation.Removed code was never executed since Qt5 is now required
or contained outdated documentation.https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1108STYLE: Replace ITK_NULLPTR with nullptr2019-03-13T11:39:14-04:00phcerdanSTYLE: Replace ITK_NULLPTR with nullptrThis commit replaces occurences of the ITK_NULLPTR macro with nullptr. This one-liner
was used to perform the update:
```
git grep -l "ITK_NULLPTR" | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e "s/ITK_NULLPTR/null...This commit replaces occurences of the ITK_NULLPTR macro with nullptr. This one-liner
was used to perform the update:
```
git grep -l "ITK_NULLPTR" | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e "s/ITK_NULLPTR/nullptr/g"
```
It was adapted from https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh
Updated information can be found in the wiki:
https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval#C.2B.2B11:_Update_source_code_to_use_nullptrhttps://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1109STYLE: Replace VTK_OVERRIDE with override2019-03-13T12:04:55-04:00phcerdanSTYLE: Replace VTK_OVERRIDE with overrideThis commit replaces occurences of the VTK_OVERRIDE macro with override. This one-liner
was used to perform the update:
git grep -l "VTK_OVERRIDE" | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e "s/VTK_OVERRIDE/overri...This commit replaces occurences of the VTK_OVERRIDE macro with override. This one-liner
was used to perform the update:
git grep -l "VTK_OVERRIDE" | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e "s/VTK_OVERRIDE/override/g"https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1110BUG: Fix MRML scene undo/redo mechanism2019-03-13T17:32:30-04:00Andras LassoBUG: Fix MRML scene undo/redo mechanismMRML scene undo/redo mechanism has been disabled for a long time and this commit keeps it that way. However, this commit contain a number of fixes for problems that initial testing of the undo/redo mechanism revealed. While the undo/redo...MRML scene undo/redo mechanism has been disabled for a long time and this commit keeps it that way. However, this commit contain a number of fixes for problems that initial testing of the undo/redo mechanism revealed. While the undo/redo infrastructure is still not ready for general use, these fixes allow enabling it for selected nodes in custom applications.
- Add flag to enable/disable undo/redo tracking for nodes. This allows enabling undo/redo only for selected nodes, that are implemented carefully to work well with undo/redo.
- Enforce maximum stack size on undo and redo stacks.
- Node IDs that are referenced within the node stack and are not within the scene are considered to be in use for the purpose of generating unique node ids (this makes sure no node ID conflicts can occur between new nodes and nodes that were restored from the undo stack).
- Add missing SaveStateForUndo calls into Markups widgets.
- Always save the full scene state - saving only state of selected nodes can break node references and make the state of the scene inconsistent. Even if a Slice core module would think that as a result of a user action only specific nodes are updated, due to behavior of custom modules, it is possible that a simple node change triggers events that change state of other nodes, which would not be possible to revert without saving the state of all nodes.
- Add flag to be able to disable automatic display node creation for Markups.
- Removed SaveStateForUndo calls from logic and MRML classes. Undo/Redo should be handled at the application/GUI level and not at MRML library level (at the library level it is not known when is a good time to save a new state).
Co-authored-by: Kyle Sunderland <sunderlandkyl@gmail.com>https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1102ENH: Modernize: use nullptr instead of NULL or 02019-03-12T20:17:40-04:00phcerdanENH: Modernize: use nullptr instead of NULL or 0Update associated with this PR are documented on the wiki. See [C++11: Update source code to use nullptr](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval#C.2B.2B11:_Update_source_...Update associated with this PR are documented on the wiki. See [C++11: Update source code to use nullptr](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval#C.2B.2B11:_Update_source_code_to_use_nullptr)
https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1091ENH: Added new node types to support custom volume rendering shader code2019-03-05T00:10:51-05:00Simon DrouinENH: Added new node types to support custom volume rendering shader codeWith this PR, we introduce a mechanism to manage and store custom modifications and variables of volume rendering shaders. This pull request requires changes to VTK contained in this other pull request:
https://github.com/Slicer/VTK/p...With this PR, we introduce a mechanism to manage and store custom modifications and variables of volume rendering shaders. This pull request requires changes to VTK contained in this other pull request:
https://github.com/Slicer/VTK/pull/21
This change in VTK separates the management of vtkUniforms and shader replacements from the volume mapper and stores all these properties in a new class (vtkShaderProperty), which is stored in vtkVolume. On the Slicer side, I have created wrappers classes to manage vtkShaderProperty:
* vtkMRMLShaderPropertyNode
* vtkMRMLShaderPropertyStorageNode
* qSlicerShaderPropertyReader
The advantages of the new system are twofold:
* Custom shader modifications are contained in a class that is shared by all displayable managers, i.e. your custom shader effect is visible in both the 3D view and the VR view.
* Custom modifications to the shaders are now saved with the mrml scene (in a json file with extension .sp), which means that GLSL experts can modify the shader code and variables, send the scene to non-programmers (e.g. clinicians) who will be able to load and visualize the new rendering effect by simply loading the scene.
@lassoan @pieper @cpinter @jcfr please let me know what you think. https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1087BUG: DicomWidgets - Do not assume that the extensions manager exists2019-03-14T14:40:36-04:00Sam HorvathBUG: DicomWidgets - Do not assume that the extensions manager exists*Created by: vovythevov*
Since Slicer may not be built with the extension manager enabled,
qSlicerCoreApplication::extentionsManagerModel may not exists (it's
surrounded by #ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT).*Created by: vovythevov*
Since Slicer may not be built with the extension manager enabled,
qSlicerCoreApplication::extentionsManagerModel may not exists (it's
surrounded by #ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT).https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1089ENH: adds hook for loading directory archetypes2019-02-09T12:27:42-05:00Steve PieperENH: adds hook for loading directory archetypesWhen a directory is added via the Add Data dialog,
it may contain a collection of files that should be
treated as a single MRML data type, such as a series
of image files that get loaded as a volume.
This change allows a qSlicerFil...When a directory is added via the Add Data dialog,
it may contain a collection of files that should be
treated as a single MRML data type, such as a series
of image files that get loaded as a volume.
This change allows a qSlicerFileReader subclass to define
a method that can examine the contents of a directory and
filter out any files that should be loaded as a group. One
of these files then serves as the archetype and the io properties
can be configured such that the files are loaded correctly.https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1086ENH: Support for scripted module internationalization **WIP** DO NOT MERGE2019-03-14T14:40:36-04:00Sam HorvathENH: Support for scripted module internationalization **WIP** DO NOT MERGE*Created by: jcfr*
Co-authored-by: Carlos Luque <carlos.luque@ulpgc.es>*Created by: jcfr*
Co-authored-by: Carlos Luque <carlos.luque@ulpgc.es>https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1085ENH: Friendlier segment editor widget for better intergration in layouts2019-03-14T14:40:35-04:00Sam HorvathENH: Friendlier segment editor widget for better intergration in layouts*Created by: vovythevov*
This PR aims to simplify integration of the Segment Editor widget in other widget.
Here is an illustration of what it looks like with and without this PR.
![illustration](https://user-images.githubusercontent....*Created by: vovythevov*
This PR aims to simplify integration of the Segment Editor widget in other widget.
Here is an illustration of what it looks like with and without this PR.
![illustration](https://user-images.githubusercontent.com/426898/52011108-15798500-24a5-11e9-87ba-09c5482781b6.png)
The code used to generate this is here:
[SegmentEditorUIFix.zip](https://github.com/Slicer/Slicer/files/2814355/SegmentEditorUIFix.zip)
https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1081Add dicomweb client2019-02-08T16:09:05-05:00Steve PieperAdd dicomweb clientThis works for me on mac, but I believe it's right for other platforms too. @jcfr can you have a look?This works for me on mac, but I believe it's right for other platforms too. @jcfr can you have a look?https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1084Extension widgets re-usable from QFormBuilder (slicer.util.loadUI)2019-01-29T14:19:01-05:00Adam RankinExtension widgets re-usable from QFormBuilder (slicer.util.loadUI)Fixes #4670
Extension plugin path is installed into Slicer-XYZ.ini configuration file when extension is installed, removed when extension is removed.
Build tree fixes are not required as plugin library is installed into Slicer root...Fixes #4670
Extension plugin path is installed into Slicer-XYZ.ini configuration file when extension is installed, removed when extension is removed.
Build tree fixes are not required as plugin library is installed into Slicer root plugin folderhttps://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1076Constrain fiducials (WIP, do not merge)2019-01-19T14:49:00-05:00Steve PieperConstrain fiducials (WIP, do not merge)This works pretty well, and can be a placeholder until the more comprehensive markup overhaul is ready.
You might want to try it and see if we can figure out how to make the fiducial 'stick' to the mouse, but if not I think okay as-is...This works pretty well, and can be a placeholder until the more comprehensive markup overhaul is ready.
You might want to try it and see if we can figure out how to make the fiducial 'stick' to the mouse, but if not I think okay as-is and better than the default behavior. I'd be tempted to include it as-is in the 4.10.2 patch release.
Note that I looked into making it possible to toggle this behavior, but didn't see how to get access to state from a QSetting into a vtkMRMLDisplayableManager (some options discussed in the commit message). @jcfr or @lassoan any thoughts?https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1075ENH: Simplify segmentation filled slice view - ONLY MERGE IN SLICER52019-03-11T00:54:25-04:00Andras LassoENH: Simplify segmentation filled slice view - ONLY MERGE IN SLICER5vtkContourTriangulator is simpler and probably more robust than vtkStripper+vtkCleanPolyData+vtkTriangleFilter.
To give it some more testing time, only merge this after Slicer-4.10.1 is released.vtkContourTriangulator is simpler and probably more robust than vtkStripper+vtkCleanPolyData+vtkTriangleFilter.
To give it some more testing time, only merge this after Slicer-4.10.1 is released.https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1068Update support for newer dcmtk locking2019-01-02T13:07:27-05:00Hans JohnsonUpdate support for newer dcmtk lockinghttps://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1061ENH: Create new view to embed DICOM browser in main widget2019-01-16T17:48:42-05:00SunderlandkylENH: Create new view to embed DICOM browser in main widgetAccomplished through the use of the new view factory qSlicerSingletonViewFactory.
Both C++ and Python classes can register any singleton QWidget by calling factory->setWidget(QWidget*) and factory->setTagName(std::string).
The DICOM ...Accomplished through the use of the new view factory qSlicerSingletonViewFactory.
Both C++ and Python classes can register any singleton QWidget by calling factory->setWidget(QWidget*) and factory->setTagName(std::string).
The DICOM browser layout is registered as a single view which spans the whole widget.
Navigating to the DICOM browser module will change to this new layout and hide the data probe, while navigating to a different widget, loading a series (with browser persistence off), or clicking the new "Close" button, will restore the previous layout and settings.
See discussion: https://discourse.slicer.org/t/dicom-browser-is-stuck-behind-main-window-after-dicom-import/4826/24
![image](https://user-images.githubusercontent.com/9222709/49972209-e318c600-fefe-11e8-8556-60e76e9c6ffe.png)
https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1052ENH: Allow for custom presets prefix and tooltips2019-03-14T14:40:23-04:00Sam HorvathENH: Allow for custom presets prefix and tooltips*Created by: vovythevov*
Although Slicer allowed to create custom presets for the Slice views, it
did not allow the user to customize the tooltip nor the prefix that would
show in the view.
It is now possible to customize each of the...*Created by: vovythevov*
Although Slicer allowed to create custom presets for the Slice views, it
did not allow the user to customize the tooltip nor the prefix that would
show in the view.
It is now possible to customize each of the slice views preset to have
a custom prefix and/or tooltip.https://gitlab.kitware.com/sjh26/Slicer/-/merge_requests/1045ENH: Allow specifying study, series, content datetime for DICOM image export2018-11-20T14:35:44-05:00Andras LassoENH: Allow specifying study, series, content datetime for DICOM image exportIt was not possible to export 4D data sets, because study, series, frame of reference UIDs were always generated and it was not possible to set content time (to distinguish between image frames at the same spatial position at different t...It was not possible to export 4D data sets, because study, series, frame of reference UIDs were always generated and it was not possible to set content time (to distinguish between image frames at the same spatial position at different time points).
Now study, series, frame of reference UIDs can be specified optionally and study, series, content date&time can be set.