Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Eamon Doyle
roiTool
Commits
5ff96515
Commit
5ff96515
authored
Apr 10, 2024
by
Eamon Doyle
Browse files
add debug verbosity
parent
5c89546d
Changes
1
Show whitespace changes
Inline
Side-by-side
mergeRoiTool.m
View file @
5ff96515
...
...
@@ -18,6 +18,8 @@ function varargout = mergeRoiTool(varargin)
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% set global variable mergeDebugVerbosity to >0 if you want more debug
%
% See also: GUIDE, GUIDATA, GUI
% Edit the above text to modify the response to help mergeRoiTool
...
...
@@ -52,6 +54,12 @@ function mergeRoiTool_OpeningFcn(hObject, eventdata, handles, varargin)
% varargin command line arguments to mergeRoiTool (see VARARGIN)
% Choose default command line output for mergeRoiTool
global
mergeDebugVerbosity
if
isempty
(
mergeDebugVerbosity
)
handles
.
debug
=
0
;
else
handles
.
debug
=
mergeDebugVerbosity
;
end
handles
.
output
=
hObject
;
handles
.
needsReload
=
1
;
handles
.
roi
=
struct
;
...
...
@@ -99,14 +107,14 @@ try
set
(
handles
.
checkbox_saved
,
'Value'
,
1
,
'BackgroundColor'
,
'g'
);
axes
(
handles
.
axes1
);
%warn('here')
h
=
imagesc
([
0
0
;
0
0
])
h
=
imagesc
([
0
0
;
0
0
])
;
%set(h,'HitTest','off')
get
(
h
)
%
get(h)
;
%set(h,'ButtonDownFcn',@axes1_ButtonDownFcn)
handles
.
needsReload
=
1
;
msgbox
(
'ROI Saved Successfully'
)
msgbox
(
'ROI Saved Successfully'
)
;
catch
h
=
warndlg
(
'Save failed. Nothing saved'
);
end
...
...
@@ -197,7 +205,7 @@ handles.path = path;
handles
.
needsReload
=
1
;
files
=
dir
(
path
);
dcmlist
=
struct
;
setProgress
(
hObject
,
eventdata
,
handles
,
0
,
'Loading...'
)
setProgress
(
hObject
,
eventdata
,
handles
,
0
,
'Loading...'
)
;
for
n
=
3
:
length
(
files
);
fp
=
[
path
'/'
files
(
n
)
.
name
];
if
~
files
(
n
)
.
isdir
&&
isdicom
(
fp
)
&&
(
isempty
(
strfind
(
files
(
n
)
.
name
,
'XX'
))
&&
isempty
(
strfind
(
files
(
n
)
.
name
,
'PS'
)))
...
...
@@ -364,7 +372,7 @@ path = handles.dcmlist(imagenum).path;
axes
(
handles
.
axes1
);
images
=
dicomread
(
path
);
%h = imagesc(images(:,:,1,1),'HitTest','off');
set
(
handles
.
imageHandle
,
'CData'
,
images
(:,:,
1
,
1
))
set
(
handles
.
imageHandle
,
'CData'
,
images
(:,:,
1
,
1
))
;
%h = imagesc(images(:,:,1,1));
set
(
handles
.
sliceCount
,
'String'
,
sprintf
(
'/ %i'
,
size
(
images
,
4
)));
%get(gca,'HitTest')
...
...
@@ -603,25 +611,37 @@ function axes1_ButtonDownFcn(hObject, eventdata, handles)
drawnow
handles
=
guidata
(
hObject
);
%colormap('gray');
disp
(
'yes it ran'
)
datetime
currentPoint
=
get
(
gca
,
'currentpoint'
)
currentBox
=
currentPoint
(
1
,
1
:
2
)
handles
if
handles
.
debug
>
3
disp
(
'yes it ran'
)
datetime
end
currentPoint
=
get
(
gca
,
'currentpoint'
);
currentBox
=
currentPoint
(
1
,
1
:
2
);
if
handles
.
debug
>
3
currentPoint
currentBox
handles
end
%handles2 = guihandles(hObject)
%handles2
%size(handles.lungMatrix)
lungGridSize
=
handles
.
lungGridSize
;
lungGridMatSize
=
size
(
handles
.
lungMatrix
)
lungMatLoc
=
floor
(
currentBox
)
lmy
=
floor
(
lungMatLoc
(
1
)
.
/
size
(
handles
.
imageMat
,
2
)
*
lungGridMatSize
(
2
))
lmx
=
floor
(
lungMatLoc
(
2
)
.
/
size
(
handles
.
imageMat
,
1
)
*
lungGridMatSize
(
1
))
lungGridMatSize
=
size
(
handles
.
lungMatrix
)
;
lungMatLoc
=
floor
(
currentBox
)
;
lmy
=
floor
(
lungMatLoc
(
1
)
.
/
size
(
handles
.
imageMat
,
2
)
*
lungGridMatSize
(
2
))
;
lmx
=
floor
(
lungMatLoc
(
2
)
.
/
size
(
handles
.
imageMat
,
1
)
*
lungGridMatSize
(
1
))
;
currentSlice
=
get
(
handles
.
slider2
,
'Value'
);
currentSlice
if
handles
.
debug
>
3
lungGridMatSize
lungMatLoc
lmy
lmx
currentSlice
end
handles
.
lungMatrix
(
lmx
,
lmy
,
1
,
currentSlice
)
=
mod
(
handles
.
lungMatrix
(
lmx
,
lmy
,
1
,
currentSlice
)
+
1
,
5
);
handles
.
lungMatrix
(:,:,
1
,
currentSlice
);
guidata
(
hObject
,
handles
)
guidata
(
hObject
,
handles
)
;
redrawImage
(
hObject
,
eventdata
,
handles
);
%r = rectangle('Position',[lungMatLoc.*lungGridSize lungMatLoc.*lungGridSize+[lungGridSize,lungGridSize]],'FaceColor',[0.5 0.5 0.5] )
...
...
@@ -631,7 +651,7 @@ redrawImage(hObject, eventdata, handles);
%tableData = {xlist(1),ylist(1),SliderLocation};
%set(handles.CoordinateTable,'Data',tableData)
% Update handles structure
guidata
(
hObject
,
handles
)
guidata
(
hObject
,
handles
)
;
function
mouseClick
(
~
,
~
)
disp
(
'yep'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment