Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roi from model bounds #152

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
26 changes: 26 additions & 0 deletions SVolModelROI/subVol_roi_model/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.16.3...3.19.7 FATAL_ERROR)

project(subVol_roi_model)

#-----------------------------------------------------------------------------
# Extension meta-information
set(EXTENSION_HOMEPAGE "https://www.slicer.org/wiki/Documentation/Nightly/Extensions/subVol_roi_model")
set(EXTENSION_CONTRIBUTORS "John Doe (AnyWare Corp.)")
set(EXTENSION_DESCRIPTION "This is an example of a simple extension")
set(EXTENSION_ICONURL "https://www.example.com/Slicer/Extensions/subVol_roi_model.png")
set(EXTENSION_SCREENSHOTURLS "https://www.example.com/Slicer/Extensions/subVol_roi_model/Screenshots/1.png")
set(EXTENSION_DEPENDS "NA") # Specified as a list or "NA" if no dependencies

#-----------------------------------------------------------------------------
# Extension dependencies
find_package(Slicer REQUIRED)
include(${Slicer_USE_FILE})

#-----------------------------------------------------------------------------
# Extension modules
add_subdirectory(roiFromModelBounds)
## NEXT_MODULE

#-----------------------------------------------------------------------------
include(${Slicer_EXTENSION_GENERATE_CONFIG})
include(${Slicer_EXTENSION_CPACK})
31 changes: 31 additions & 0 deletions SVolModelROI/subVol_roi_model/roiFromModelBounds/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#-----------------------------------------------------------------------------
set(MODULE_NAME roiFromModelBounds)

#-----------------------------------------------------------------------------
set(MODULE_PYTHON_SCRIPTS
${MODULE_NAME}.py
)

set(MODULE_PYTHON_RESOURCES
Resources/Icons/${MODULE_NAME}.png
Resources/UI/${MODULE_NAME}.ui
)

#-----------------------------------------------------------------------------
slicerMacroBuildScriptedModule(
NAME ${MODULE_NAME}
SCRIPTS ${MODULE_PYTHON_SCRIPTS}
RESOURCES ${MODULE_PYTHON_RESOURCES}
WITH_GENERIC_TESTS
)

#-----------------------------------------------------------------------------
if(BUILD_TESTING)

# Register the unittest subclass in the main script as a ctest.
# Note that the test will also be available at runtime.
slicer_add_python_unittest(SCRIPT ${MODULE_NAME}.py)

# Additional build-time testing
add_subdirectory(Testing)
endif()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>roiFromModelBounds</class>
<widget class="qMRMLWidget" name="roiFromModelBounds">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>451</width>
<height>459</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="ctkCollapsibleButton" name="inputsCollapsibleButton">
<property name="text">
<string>ROI From Model</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="inputModel_label">
<property name="text">
<string>Input: Model Directory</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="ctkPathLineEdit" name="modelPath_lineEdit">
<property name="filters">
<set>ctkPathLineEdit::Dirs|ctkPathLineEdit::Drives|ctkPathLineEdit::Executable|ctkPathLineEdit::NoDot|ctkPathLineEdit::NoDotDot|ctkPathLineEdit::Readable</set>
</property>
<property name="SlicerParameterName" stdset="0">
<string>modelFile_path</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QPushButton" name="showBounds_pb">
<property name="text">
<string>Show Model Bounds</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="inputVol_label">
<property name="text">
<string>Input: Volume Node</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="qMRMLNodeComboBox" name="volumeSelector">
<property name="enabled">
<bool>true</bool>
</property>
<property name="nodeTypes">
<stringlist notr="true">
<string>vtkMRMLScalarVolumeNode</string>
</stringlist>
</property>
<property name="showChildNodeTypes">
<bool>true</bool>
</property>
<property name="hideChildNodeTypes">
<stringlist/>
</property>
<property name="noneEnabled">
<bool>true</bool>
</property>
<property name="interactionNodeSingletonTag">
<string>Singleton</string>
</property>
<property name="SlicerParamterName" stdset="0">
<string>inputVolume</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="ctkCollapsibleButton" name="outputsCollapsibleButton">
<property name="text">
<string>SubVol From ROI</string>
</property>
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="modelROI_label">
<property name="text">
<string>Model ROI</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="qMRMLNodeComboBox" name="modelROISelector">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Computed model ROI list</string>
</property>
<property name="nodeTypes">
<stringlist>
<string>vtkMRMLMarkupsROINode</string>
</stringlist>
</property>
<property name="showChildNodeTypes">
<bool>false</bool>
</property>
<property name="noneEnabled">
<bool>true</bool>
</property>
<property name="addEnabled">
<bool>true</bool>
</property>
<property name="removeEnabled">
<bool>true</bool>
</property>
<property name="SlicerParameterName" stdset="0">
<string>modelROI</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="croppedVol_label">
<property name="text">
<string>Cropped volume:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="qMRMLNodeComboBox" name="cropVolSelector">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Crop ROI bounds of InputVolume will be written into this volume</string>
</property>
<property name="nodeTypes">
<stringlist notr="true">
<string>vtkMRMLScalarVolumeNode</string>
</stringlist>
</property>
<property name="showChildNodeTypes">
<bool>false</bool>
</property>
<property name="noneEnabled">
<bool>true</bool>
</property>
<property name="addEnabled">
<bool>true</bool>
</property>
<property name="removeEnabled">
<bool>true</bool>
</property>
<property name="SlicerParameterName" stdset="0">
<string>croppedVolume</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ctkCollapsibleButton</class>
<extends>QWidget</extends>
<header>ctkCollapsibleButton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ctkPathLineEdit</class>
<extends>QWidget</extends>
<header>ctkPathLineEdit.h</header>
</customwidget>
<customwidget>
<class>qMRMLNodeComboBox</class>
<extends>QWidget</extends>
<header>qMRMLNodeComboBox.h</header>
</customwidget>
<customwidget>
<class>qMRMLWidget</class>
<extends>QWidget</extends>
<header>qMRMLWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>roiFromModelBounds</sender>
<signal>mrmlSceneChanged(vtkMRMLScene*)</signal>
<receiver>modelROISelector</receiver>
<slot>setMRMLScene(vtkMRMLScene*)</slot>
<hints>
<hint type="sourcelabel">
<x>82</x>
<y>135</y>
</hint>
<hint type="destinationlabel">
<x>326</x>
<y>237</y>
</hint>
</hints>
</connection>
<connection>
<sender>roiFromModelBounds</sender>
<signal>mrmlSceneChanged(vtkMRMLScene*)</signal>
<receiver>cropVolSelector</receiver>
<slot>setMRMLScene(vtkMRMLScene*)</slot>
<hints>
<hint type="sourcelabel">
<x>161</x>
<y>8</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>263</y>
</hint>
</hints>
</connection>
<connection>
<sender>roiFromModelBounds</sender>
<signal>mrmlSceneChanged(vtkMRMLScene*)</signal>
<receiver>volumeSelector</receiver>
<slot>setMRMLScene(vtkMRMLScene*)</slot>
<hints>
<hint type="sourcelabel">
<x>225</x>
<y>229</y>
</hint>
<hint type="destinationlabel">
<x>282</x>
<y>76</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(Python)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

#slicer_add_python_unittest(SCRIPT ${MODULE_NAME}ModuleTest.py)
Loading
Loading