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
81c55d1c
Commit
81c55d1c
authored
Apr 10, 2024
by
Eamon Doyle
Browse files
include some statistics
parent
1df5631a
Changes
2
Show whitespace changes
Inline
Side-by-side
mergeRoiTool.fig
View file @
81c55d1c
No preview for this file type
mergeRoiTool.m
View file @
81c55d1c
...
@@ -24,7 +24,7 @@ function varargout = mergeRoiTool(varargin)
...
@@ -24,7 +24,7 @@ function varargout = mergeRoiTool(varargin)
% Edit the above text to modify the response to help mergeRoiTool
% Edit the above text to modify the response to help mergeRoiTool
% Last Modified by GUIDE v2.5 1
4-Ma
r-2024 0
7:53
:1
5
% Last Modified by GUIDE v2.5 1
0-Ap
r-2024 0
8:12
:1
3
% Begin initialization code - DO NOT EDIT
% Begin initialization code - DO NOT EDIT
gui_Singleton
=
1
;
gui_Singleton
=
1
;
...
@@ -713,3 +713,51 @@ function sliceNum_KeyPressFcn(hObject, eventdata, handles)
...
@@ -713,3 +713,51 @@ function sliceNum_KeyPressFcn(hObject, eventdata, handles)
% handles structure with handles and user data (see GUIDATA)
% handles structure with handles and user data (see GUIDATA)
set
(
handles
.
slider2
,
'Value'
,
get
(
handles
.
sliceNum
,
'Value'
));
set
(
handles
.
slider2
,
'Value'
,
get
(
handles
.
sliceNum
,
'Value'
));
% --- Executes on button press in statsButton.
function
statsButton_Callback
(
hObject
,
eventdata
,
handles
)
% hObject handle to statsButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%stats text variable
st
=
"Statistics"
;
lungVoxels
=
size
(
find
(
handles
.
lungMatrix
),
1
);
lungNormal
=
size
(
find
(
handles
.
lungMatrix
==
1
),
1
);
lungHypo
=
size
(
find
(
handles
.
lungMatrix
==
2
),
1
);
lungHyper
=
size
(
find
(
handles
.
lungMatrix
==
3
),
1
);
lungBronchodyslasia
=
size
(
find
(
handles
.
lungMatrix
==
4
),
1
);
lungVol
=
-
1
;
if
strcmp
(
handles
.
dcminfo
.
SOPClassUID
,
'1.2.840.10008.5.1.4.1.1.4.1'
)
%this is an enhanced dicom
d
=
handles
.
dcminfo
;
sliceThickness
=
d
.
PerFrameFunctionalGroupsSequence
.
Item_1
.
PixelMeasuresSequence
.
Item_1
.
SliceThickness
;
sliceSpacing
=
d
.
PerFrameFunctionalGroupsSequence
.
Item_1
.
PixelMeasuresSequence
.
Item_1
.
SpacingBetweenSlices
;
if
sliceThickness
~=
sliceSpacing
warndlg
(
"Slice thickness does not equal slice spacing, lung volume may be very wrong"
);
end
pixelSpacing
=
d
.
PerFrameFunctionalGroupsSequence
.
Item_1
.
PixelMeasuresSequence
.
Item_1
.
PixelSpacing
;
pixelsPerLungMatVox
=
handles
.
lungGridSize
^
2
;
lmVoxVol
=
pixelSpacing
(
1
)
*
pixelSpacing
(
2
)
*
sliceThickness
*
pixelsPerLungMatVox
;
lungVol
=
lungVoxels
*
lmVoxVol
;
elseif
strcmp
(
handles
.
dcminfo
.
SOPClassUID
,
'1.2.840.10008.5.1.4.1.1.4'
)
% this is a classic dicom
warndlg
(
'Classic dicom does not compute lung volume stats yet'
);
else
error
(
'SOPClassUID %s not equal to MR Classic or Enhance DICOM SOPClassUID'
,
handles
.
dcminfo
.
SOPClassUID
);
end
st
=
st
+
sprintf
(
"Counts:\n"
);
st
=
st
+
sprintf
(
" Total Lung Voxels: %d (%03.2f%%)\n"
,
lungVoxels
,
100
*
lungVoxels
/
lungVoxels
);
st
=
st
+
sprintf
(
" Normal Lung Voxels: %d (%03.2f%%)\n"
,
lungNormal
,
100
*
lungNormal
/
lungVoxels
);
st
=
st
+
sprintf
(
" Hypointense Voxels: %d (%03.2f%%)\n"
,
lungHypo
,
100
*
lungHypo
/
lungVoxels
);
st
=
st
+
sprintf
(
" Hyperintense Voxels: %d (%03.2f%%)\n"
,
lungHyper
,
100
*
lungHyper
/
lungVoxels
);
st
=
st
+
sprintf
(
" Bronchodyspl Voxels: %d (%03.2f%%)\n"
,
lungBronchodyslasia
,
100
*
lungBronchodyslasia
/
lungVoxels
);
st
=
st
+
sprintf
(
"\nVolumes:\n"
);
st
=
st
+
sprintf
(
" Estimated Total Lung Volume: %06.1f cc"
,
lungVol
);
set
(
handles
.
statsTextbox
,
'String'
,
st
);
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