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

Click'n'Join-Mode extension to ITK-SNAP incuding global, dynamic watershed segmentation #1

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
140ce4c
First commit for GWS (applied itksnap-3.0.0_gWS_54.diff)
romangrothausmann Oct 9, 2014
6664d24
Added copy+clear segmentation for GWS; debugged IRISApplication::Copy…
romangrothausmann Oct 10, 2014
41de5b1
Added code to set LAYOUT_TILED for CnJ and GWS to ease understanding …
romangrothausmann Oct 14, 2014
b48eabc
First commit for dWS (applied itksnap-3.0.0_dynWS+direct_09.diff)
romangrothausmann Nov 4, 2014
9d04eb8
Merge branch 'dWS' into gdWS
romangrothausmann Nov 4, 2014
f60ab32
modifications for transit for Jsrc from LabelType to GWSType
romangrothausmann Nov 30, 2014
a534ec3
added progress-report on stderr to GWS
romangrothausmann Mar 4, 2015
abe5eec
Merge branch 'gdWS' into master+gdWS,
romangrothausmann Mar 9, 2015
aba99b1
new GIF for btnSnakeInspector, as this is used for ROI selection not …
romangrothausmann Mar 9, 2015
b12681f
some comments in the code how ToolbarModeType and mode_inspector_btn …
romangrothausmann Mar 9, 2015
32fa365
using LinearColorMapDisplayMappingPolicy, basically works but bound t…
romangrothausmann Mar 12, 2015
378711a
created JsrcDisplayMappingPolicy which can handle 64-bit and uses itk…
romangrothausmann Mar 13, 2015
b839530
added basic "load from file" functionality
romangrothausmann Mar 13, 2015
be9a687
Merge branch 'Jsrc_64bit' into gdWS
romangrothausmann Mar 13, 2015
9975472
label 0 now fully transparent when using JsrcDisplayMappingPolicy
romangrothausmann Mar 13, 2015
d4ee054
Merge branch 'Jsrc_64bit' into gdWS
romangrothausmann Mar 13, 2015
f339f1f
cleaned up ImageWrapperTraits.h
romangrothausmann Mar 13, 2015
b33954e
Merge branch 'Jsrc_64bit' into gdWS
romangrothausmann Mar 13, 2015
c255277
Merge branch 'gdWS' into master+gdWS
romangrothausmann Mar 13, 2015
52bcb13
added functionality to some GWS buttons
romangrothausmann Mar 17, 2015
5e969b3
Merge branch 'gdWS' into master+gdWS
romangrothausmann Mar 17, 2015
739001a
split up PrecomputeWatersheds to ComputeWSImage on btnNextPreproc_cli…
romangrothausmann Mar 21, 2015
9c49ced
introduced "GWS source image" (WsrcImage) layer to vis gWS preprocess…
romangrothausmann Mar 21, 2015
488dcd3
WsrcImage now visible in Slice-View
romangrothausmann Mar 21, 2015
7679da5
finer graded setting of visibility and stickyness for CnJ and gWS
romangrothausmann Mar 21, 2015
8ebd02b
Merge branch 'gdWS' into master+gdWS
romangrothausmann Mar 23, 2015
6c5fbf2
make segementation visibile when entering and leaving CnJ and gWS
romangrothausmann Mar 23, 2015
30a80e2
saving images compressed
romangrothausmann Mar 23, 2015
3490ca9
Merge branch 'gdWS' into master+gdWS
romangrothausmann Mar 23, 2015
ca7964d
disabled loading of segmentations (and other actions) during gWS (and…
romangrothausmann Mar 26, 2015
e98eb34
basic implementation of loading an external segementation image into …
romangrothausmann Apr 15, 2015
619adcb
Merge branch 'gdWS' into master+gdWS
romangrothausmann Apr 15, 2015
3186e70
BUG: preventing crash due to overflow for large int vectors by circum…
romangrothausmann Jun 15, 2015
b721ca0
Merge branch 'master+Debug_IRISSlicer' into master+gdWS
romangrothausmann Jun 15, 2015
bc2bfac
BUG: preventing crash due to overflow for large int vectors by circum…
romangrothausmann Jun 16, 2015
b4a75da
ENH: made LoadImageToJsrc use less memory
romangrothausmann Jun 16, 2015
4e1fe19
Merge branch 'LoadImageToJsrc' into gdWS
romangrothausmann Jun 16, 2015
dce9319
Merge branch 'gdWS' into master+gdWS
romangrothausmann Jun 16, 2015
3176abc
added defaults to ImageWrapper.h to make last merge work
romangrothausmann Jun 16, 2015
f617279
Fixed wraparound behavior of drawing tools in slice views
pyushkevich Oct 17, 2015
35787de
Compile error fix on Qt4
pyushkevich Oct 17, 2015
71f6c08
Merge branch 'master' into rel_3.4
pyushkevich Nov 30, 2015
6cf1430
Set version to 3.4.0
pyushkevich Nov 30, 2015
145508b
Fixed problem created during merge with CDash drop site
pyushkevich Dec 3, 2015
55a738f
Release notes edited for 3.4
pyushkevich Dec 3, 2015
01a7ddf
Merge tag 'v3.4.0' into master+gdWS
romangrothausmann Jan 30, 2018
c41af1d
btnJoin was not visible (with/out changes from v3.4)
romangrothausmann Jan 30, 2018
3281344
actionToggleJsrcVis was missing (with/out changes from v3.4)
romangrothausmann Jan 30, 2018
ef40b5d
pass transform to JOIN data (for v>3.0.0, according to SNAPImageData …
romangrothausmann Jan 31, 2018
6e31ad8
basic implementation of JoinCopyFilter and its integration into CnJ
romangrothausmann May 8, 2015
9f0332c
avoid SetImage (looses coord transf from InitializeToWrapper), no seg…
romangrothausmann Jan 31, 2018
5bcf696
simplified itkJoinCopyFilter according to InplaceImageFilter example:
romangrothausmann Jan 31, 2018
1b63ff4
set JoinCF-output as Jdst (filter working now), see comment in exampl…
romangrothausmann Jan 31, 2018
a714e11
progress report for itkJoinCopyFilter (from 82f72dc9)
romangrothausmann Jan 31, 2018
f68d5fb
Revert "saving images compressed"
romangrothausmann Jan 31, 2018
14fb16b
disabled StoreUndoPoint (has no effect so far, only takes time)
romangrothausmann Feb 1, 2018
3ef7511
Merge branch 'JoinFilter' into master+gdWS
romangrothausmann Sep 10, 2018
ad75795
ToDo update
romangrothausmann Sep 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ endforeach()
# These four fields should be modified when versions change
SET(SNAP_VERSION_MAJOR 3)
SET(SNAP_VERSION_MINOR 4)
SET(SNAP_VERSION_PATCH 1)
SET(SNAP_VERSION_QUALIFIER "-alpha")
SET(SNAP_VERSION_PATCH 0)
SET(SNAP_VERSION_QUALIFIER "")

# These fields should also be modified each time
SET(SNAP_VERSION_RELEASE_DATE "20151017")
SET(SNAP_VERSION_RELEASE_DATE_FORMATTED "Oct 17, 2015")
SET(SNAP_VERSION_RELEASE_DATE "20151130")
SET(SNAP_VERSION_RELEASE_DATE_FORMATTED "Nov 30, 2015")

# This field should only change when the format of the settings files changes
# in a non backwards-compatible way
Expand Down Expand Up @@ -209,6 +209,7 @@ SET(LOGIC_CXX
Logic/Framework/IRISImageData.cxx
Logic/Framework/LayerIterator.cxx
Logic/Framework/SNAPImageData.cxx
Logic/Framework/JOINImageData.cxx
Logic/Framework/UndoDataManager_LabelType.cxx
Logic/ImageWrapper/CommonRepresentationPolicy.cxx
Logic/ImageWrapper/DisplayMappingPolicy.cxx
Expand Down Expand Up @@ -308,6 +309,7 @@ SET(LOGIC_HEADERS
Logic/Framework/LayerAssociation.txx
Logic/Framework/LayerIterator.h
Logic/Framework/SNAPImageData.h
Logic/Framework/JOINImageData.h
Logic/Framework/UndoDataManager.h
Logic/Framework/UndoDataManager.txx
Logic/ImageWrapper/CommonRepresentationPolicy.h
Expand Down Expand Up @@ -409,6 +411,8 @@ SET(UI_GENERIC_CXX
GUI/Model/SnakeROIModel.cxx
GUI/Model/SnakeROIResampleModel.cxx
GUI/Model/SnakeWizardModel.cxx
GUI/Model/JoinModel.cxx
GUI/Model/GlobalWSWizardModel.cxx
GUI/Model/StateManagement.cxx
GUI/Model/SynchronizationModel.cxx
GUI/Model/UIAction.cxx
Expand Down Expand Up @@ -481,6 +485,8 @@ SET(UI_GENERIC_HEADERS
GUI/Model/SnakeROIModel.h
GUI/Model/SnakeROIResampleModel.h
GUI/Model/SnakeWizardModel.h
GUI/Model/JoinModel.h
GUI/Model/GlobalWSWizardModel.h
GUI/Model/StateManagement.h
GUI/Model/SynchronizationModel.h
GUI/Model/UIAction.h
Expand Down Expand Up @@ -552,6 +558,8 @@ SET(UI_QT_CXX
GUI/Qt/Components/RecentHistoryItemsView.cxx
GUI/Qt/Components/SnakeToolROIPanel.cxx
GUI/Qt/Components/SnakeWizardPanel.cxx
GUI/Qt/Components/JoinDataPanel.cxx
GUI/Qt/Components/GlobalWSWizardPanel.cxx
GUI/Qt/Components/SNAPComponent.cxx
GUI/Qt/Components/SNAPQtCommon.cxx
GUI/Qt/Components/SliceViewPanel.cxx
Expand All @@ -576,6 +584,7 @@ SET(UI_QT_CXX
GUI/Qt/View/PolygonDrawingInteractionMode.cxx
GUI/Qt/View/SliceWindowInteractionDelegateWidget.cxx
GUI/Qt/View/SnakeROIInteractionMode.cxx
GUI/Qt/View/JoinInteractionMode.cxx
GUI/Qt/View/ThumbnailInteractionMode.cxx
GUI/Qt/Windows/AboutDialog.cxx
GUI/Qt/Windows/DropActionDialog.cxx
Expand Down Expand Up @@ -636,6 +645,8 @@ SET(UI_MOC_HEADERS
GUI/Qt/Components/RecentHistoryItemsView.h
GUI/Qt/Components/SnakeToolROIPanel.h
GUI/Qt/Components/SnakeWizardPanel.h
GUI/Qt/Components/JoinDataPanel.h
GUI/Qt/Components/GlobalWSWizardPanel.h
GUI/Qt/Components/SNAPComponent.h
GUI/Qt/Components/SliceViewPanel.h
GUI/Qt/Components/SynchronizationInspector.h
Expand All @@ -659,6 +670,7 @@ SET(UI_MOC_HEADERS
GUI/Qt/View/PolygonDrawingInteractionMode.h
GUI/Qt/View/SliceWindowInteractionDelegateWidget.h
GUI/Qt/View/SnakeROIInteractionMode.h
GUI/Qt/View/JoinInteractionMode.h
GUI/Qt/View/ThumbnailInteractionMode.h
GUI/Qt/Windows/AboutDialog.h
GUI/Qt/Windows/DropActionDialog.h
Expand Down Expand Up @@ -734,6 +746,8 @@ SET(UI_FORMS
GUI/Qt/Components/SliceViewPanel.ui
GUI/Qt/Components/SnakeToolROIPanel.ui
GUI/Qt/Components/SnakeWizardPanel.ui
GUI/Qt/Components/JoinDataPanel.ui
GUI/Qt/Components/GlobalWSWizardPanel.ui
GUI/Qt/Components/SynchronizationInspector.ui
GUI/Qt/Components/ViewPanel3D.ui
GUI/Qt/Components/ZoomInspector.ui
Expand Down
6 changes: 3 additions & 3 deletions CTestConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
## ENABLE_TESTING()
## INCLUDE(CTest)

set(CTEST_PROJECT_NAME "ITK-SNAP master")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
set(CTEST_PROJECT_NAME "ITK-SNAP 3.4")
set(CTEST_NIGHTLY_START_TIME "00:00:00 UTC")

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "itksnap.org")
set(CTEST_DROP_LOCATION "/cdash/submit.php?project=ITK-SNAP+master")
set(CTEST_DROP_LOCATION "/cdash/submit.php?project=ITK-SNAP+3.4")
set(CTEST_DROP_SITE_CDASH TRUE)
4 changes: 4 additions & 0 deletions Common/SNAPCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ extern const char SNAPBuildInfo[];
// UnaryFunctorCache in the GreyImageWrapper type. Greyscale instensities
// 0 to MAXGREYVAL are used in a cache table, which would be too big with int
typedef unsigned short LabelType;
typedef itk::IdentifierType GWSType;
typedef GWSType JSRType;
typedef float WSRType;
typedef short GreyType;
extern const GreyType MAXGREYVAL;
extern const GreyType MINGREYVAL;
Expand All @@ -117,6 +120,7 @@ enum LayerRole
SNAP_ROLE = 0x0004,
LABEL_ROLE = 0x0008,
NO_ROLE = 0x0010,
JOIN_ROLE = 0x0020,
ALL_ROLES = 0xffffffff
};

Expand Down
1 change: 1 addition & 0 deletions GUI/Model/CursorInspectionModel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ void CursorInspectionModel::SetParentModel(GlobalUIModel *parent)
int role =
MAIN_ROLE |
OVERLAY_ROLE |
JOIN_ROLE |
SNAP_ROLE;

CurrentVoxelInfoItemSetDomain dom(parent, role);
Expand Down
145 changes: 142 additions & 3 deletions GUI/Model/GlobalUIModel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <PolygonDrawingModel.h>
#include <AnnotationModel.h>
#include <SnakeROIModel.h>
#include <JoinModel.h>
#include <SliceWindowCoordinator.h>
#include <GenericImageData.h>
#include <GuidedNativeImageIO.h>
Expand All @@ -47,6 +48,7 @@
#include <LabelEditorModel.h>
#include <CursorInspectionModel.h>
#include <SnakeWizardModel.h>
#include <GlobalWSWizardModel.h>
#include <RandomAccessCollectionModel.h>
#include <UIReporterDelegates.h>
#include <ReorientImageModel.h>
Expand Down Expand Up @@ -112,6 +114,9 @@ GlobalUIModel::GlobalUIModel()
m_SnakeROIModel[i] = SnakeROIModel::New();
m_SnakeROIModel[i]->SetParent(m_SliceModel[i]);

m_JoinModel[i] = JoinModel::New();
m_JoinModel[i]->SetParent(m_SliceModel[i]);

m_PaintbrushModel[i] = PaintbrushModel::New();
m_PaintbrushModel[i]->SetParent(m_SliceModel[i]);

Expand Down Expand Up @@ -149,7 +154,7 @@ GlobalUIModel::GlobalUIModel()
m_LoadedLayersSelectionModel->SetParentModel(this);
m_LoadedLayersSelectionModel->SetRoleFilter(
MAIN_ROLE | OVERLAY_ROLE |
SNAP_ROLE);
SNAP_ROLE | JOIN_ROLE);

// 3D model
m_Model3D = Generic3DModel::New();
Expand All @@ -175,6 +180,10 @@ GlobalUIModel::GlobalUIModel()
m_SnakeROIResampleModel = SnakeROIResampleModel::New();
m_SnakeROIResampleModel->SetParentModel(this);

// GlobalWS model
m_GlobalWSWizardModel = GlobalWSWizardModel::New();
m_GlobalWSWizardModel->SetParentModel(this);

// Synchronization model
m_SynchronizationModel = SynchronizationModel::New();
m_SynchronizationModel->SetParentModel(this);
Expand Down Expand Up @@ -311,11 +320,12 @@ bool GlobalUIModel::CheckState(UIState state)
case UIF_BASEIMG_LOADED:
return m_Driver->IsMainImageLoaded();
case UIF_IRIS_WITH_BASEIMG_LOADED:
return m_Driver->IsMainImageLoaded() && !m_Driver->IsSnakeModeActive();
return m_Driver->IsMainImageLoaded() && !m_Driver->IsSnakeModeActive();// && !m_Driver->IsJoinModeActive(); ///adding this will disable lablel change in Join mode, use UIF_NOT_SNAKE_OR_JOIN_MODE if needed.
case UIF_IRIS_MODE:
return !m_Driver->IsSnakeModeActive();
return !m_Driver->IsSnakeModeActive() && !m_Driver->IsJoinModeActive();//not sure if Join extension here has any effect
case UIF_IRIS_WITH_OVERLAY_LOADED:
return m_Driver->IsMainImageLoaded() && !m_Driver->IsSnakeModeActive()
&& !m_Driver->IsJoinModeActive()
&& m_Driver->GetCurrentImageData()->GetNumberOfOverlays() > 0;
case UIF_ROI_VALID:
break;
Expand All @@ -333,6 +343,10 @@ bool GlobalUIModel::CheckState(UIState state)
return m_Driver->GetCurrentImageData()->IsOverlayLoaded();
case UIF_SNAKE_MODE:
return m_Driver->IsSnakeModeActive();
case UIF_JOIN_MODE:
return m_Driver->IsJoinModeActive();
case UIF_NOT_SNAKE_OR_JOIN_MODE:
return m_Driver->IsMainImageLoaded() && !m_Driver->IsSnakeModeActive() && !m_Driver->IsJoinModeActive();
case UIF_LEVEL_SET_ACTIVE:
return m_Driver->IsSnakeModeLevelSetActive();
case UIF_MULTIPLE_BASE_LAYERS:
Expand Down Expand Up @@ -402,6 +416,99 @@ void GlobalUIModel::ToggleOverlayVisibility()
m_LayerGeneralPropertiesModel->SetLayer(curr_layer);
}

void GlobalUIModel::ToggleJsrcVisibility()
{
// Are we in JOIN mode?
if(CheckState(UIF_JOIN_MODE)){
GenericImageData *id = m_Driver->GetCurrentImageData();

// Remember what layer is current in the general properties model
ImageWrapperBase *curr_layer = m_LayerGeneralPropertiesModel->GetLayer();

// Apply the toggle for all overlays
for(LayerIterator it = id->GetLayers(JOIN_ROLE); !it.IsAtEnd(); ++it){
//if(dynamic_cast<JsrcImageWrapper *>(it.GetLayer())){//not tested
if(strcmp(it.GetLayer()->GetNickname().c_str(), "Join Source Image") == 0){
m_LayerGeneralPropertiesModel->SetLayer(it.GetLayer());
m_LayerGeneralPropertiesModel->GetLayerVisibilityModel()->SetValue(
!m_LayerGeneralPropertiesModel->GetLayerVisibilityModel()->GetValue());
}
}

// Restore the active layer
m_LayerGeneralPropertiesModel->SetLayer(curr_layer);
}
}

void GlobalUIModel::SetJsrcVisibility(bool set)
{
// Are we in JOIN mode?
if(CheckState(UIF_JOIN_MODE)){
GenericImageData *id = m_Driver->GetCurrentImageData();

// Remember what layer is current in the general properties model
ImageWrapperBase *curr_layer = m_LayerGeneralPropertiesModel->GetLayer();

// Apply the toggle for all overlays
for(LayerIterator it = id->GetLayers(JOIN_ROLE); !it.IsAtEnd(); ++it){
//if(dynamic_cast<JsrcImageWrapper *>(it.GetLayer())){//not tested
if(strcmp(it.GetLayer()->GetNickname().c_str(), "Join Source Image") == 0){
m_LayerGeneralPropertiesModel->SetLayer(it.GetLayer());
m_LayerGeneralPropertiesModel->GetLayerVisibilityModel()->SetValue(set);
}
}

// Restore the active layer
m_LayerGeneralPropertiesModel->SetLayer(curr_layer);
}
}

void GlobalUIModel::SetJdstVisibility(bool set)
{
// Are we in JOIN mode?
if(CheckState(UIF_JOIN_MODE)){
GenericImageData *id = m_Driver->GetCurrentImageData();

// Remember what layer is current in the general properties model
ImageWrapperBase *curr_layer = m_LayerGeneralPropertiesModel->GetLayer();

// Apply the toggle for all overlays
for(LayerIterator it = id->GetLayers(JOIN_ROLE); !it.IsAtEnd(); ++it){
//if(dynamic_cast<JdstImageWrapper *>(it.GetLayer())){//not tested
if(strcmp(it.GetLayer()->GetNickname().c_str(), "Join Destination Image") == 0){
m_LayerGeneralPropertiesModel->SetLayer(it.GetLayer());
m_LayerGeneralPropertiesModel->GetLayerVisibilityModel()->SetValue(set);
}
}

// Restore the active layer
m_LayerGeneralPropertiesModel->SetLayer(curr_layer);
}
}

void GlobalUIModel::SetWsrcVisibility(bool set)
{
// Are we in JOIN mode?
if(CheckState(UIF_JOIN_MODE)){
GenericImageData *id = m_Driver->GetCurrentImageData();

// Remember what layer is current in the general properties model
ImageWrapperBase *curr_layer = m_LayerGeneralPropertiesModel->GetLayer();

// Apply the toggle for all overlays
for(LayerIterator it = id->GetLayers(JOIN_ROLE); !it.IsAtEnd(); ++it){
//if(dynamic_cast<WsrcImageWrapper *>(it.GetLayer())){//not tested
if(strcmp(it.GetLayer()->GetNickname().c_str(), "GWS Source Image") == 0){
m_LayerGeneralPropertiesModel->SetLayer(it.GetLayer());
m_LayerGeneralPropertiesModel->GetLayerVisibilityModel()->SetValue(set);
}
}

// Restore the active layer
m_LayerGeneralPropertiesModel->SetLayer(curr_layer);
}
}

void GlobalUIModel::AdjustOverlayOpacity(int delta)
{
// Are we in tiled mode or in stack mode?
Expand Down Expand Up @@ -789,6 +896,38 @@ GlobalUIModel::CreateIOWizardModelForSave(ImageWrapperBase *layer, LayerRole rol
SmartPtr<AbstractSaveImageDelegate> delegate =
m_Driver->CreateSaveDelegateForLayer(layer, role);

// Figure out the category name
std::string category;
switch(role)
{
case MAIN_ROLE:
category = "Main Image";
break;
case OVERLAY_ROLE:
category = "Overlay Image";
break;
case SNAP_ROLE:
if(dynamic_cast<SpeedImageWrapper *>(layer))
category = "Speed Image";
else if(dynamic_cast<LevelSetImageWrapper *>(layer))
category = "Level Set Image";
break;
case JOIN_ROLE:
if(dynamic_cast<JsrcImageWrapper *>(layer))
category = "Join Source Image";
else if(dynamic_cast<JdstImageWrapper *>(layer))
category = "Join Destination Image";
else if(dynamic_cast<WsrcImageWrapper *>(layer))
category = "GWS Source Image";
break;
case LABEL_ROLE:
category = "Segmentation Image";
break;
case NO_ROLE:
case ALL_ROLES:
break;
}

// Create a model for IO
SmartPtr<ImageIOWizardModel> modelIO = ImageIOWizardModel::New();
modelIO->InitializeForSave(this, delegate, delegate->GetCategory().c_str());
Expand Down
Loading