Skip to content

Commit 5369b0b

Browse files
author
vijayi
committed
Minor changes
1 parent d375828 commit 5369b0b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
3.98 KB
Binary file not shown.

prepare2DImageDataset.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
arguments
77
srcFolder (1,:) char % source folder location of 3D brain volumes, organized by participant
8-
dstFolder (1,:) char = '' % destination folder for 2D horizontal midslice images, organized by age class
8+
dstFolder (1,:) char = '' % destination folder for 2D axial midslice images, organized by age class
99
augmentDataset (1,1) logical = false % specify whether to apply offline data augmentation (a copy of image flipped 180 degrees).
1010
applySkullStripping (1,1) logical = false % specify whether to apply skull-stripping
1111
end
@@ -59,7 +59,7 @@
5959
end
6060

6161

62-
% prepare2DImageDataset is a function that takes in the MRI image volume data for each label. It extracts the horizontal midslice of each MRI scan volume, applies normalization and other optional processing (skull stripping, augmentation), and saves the reduced 2D image dataset to a specified folder tree organized by label for downstream training, validation, and testing.
62+
% prepare2DImageDataset is a function that takes in the MRI image volume data for each label. It extracts the axial midslice of each MRI scan volume, applies normalization and other optional processing (skull stripping, augmentation), and saves the reduced 2D image dataset to a specified folder tree organized by label for downstream training, validation, and testing.
6363
% The function's processing options can be used to:
6464
% strip the skull from the 2D images (imType set to 'strip')
6565
% augment the dataset by saving added copies of each 2D image flipped by 180 degrees (imModify set to true)
@@ -72,7 +72,7 @@
7272

7373
[~, ~, k, ~] = size(srcData{1});
7474

75-
% Extract horizontal mid-slice from each image volume
75+
% Extract axial mid-slice from each image volume
7676
mid_slices = cellfun(@squeeze,cellfun(@double,cellfun(@(x)x(:,:,round(k/2),1),srcData,'un',0),'UniformOutput',false),'UniformOutput',false);
7777

7878
% Include data from the preprocessed image that does not include the skull
@@ -97,7 +97,7 @@
9797

9898
avg_intensity = mean(cell2mat(cellfun(@imhist,convert2img,'UniformOutput',false)),2);
9999

100-
% Create a copy if the image and rorate the image by 180 degrees
100+
% Create a copy of the image and rotate it by 180 degrees
101101
if applyAugmentation
102102
convert2img_2 = cellfun(@ind2rgb, cellfun(@(x)rot90(x,2),mid_slices,'UniformOutput',false),map,'UniformOutput',false);
103103
avg_intensity_2 = mean(cell2mat(cellfun(@imhist,convert2img_2,'UniformOutput',false)),2);

0 commit comments

Comments
 (0)