Contents

%FigureCropper.m - Use to chop up an opt3d figure for publication
%After pressing Alt-PrtScn to copy the Map output of opt3d, load the saved image into matlab and run this
%Needs work to automate

Set the image data

slide = TIMEFREQ_coronal;
% figure; image(TIMEFREQ_axial);
Undefined function or variable 'TIMEFREQ_coronal'.

Error in FigureCropper (line 7)
slide = TIMEFREQ_coronal;

Find the position of the first and second image to find the dimensions

X11_left = 43;
X11_right = 210;
X12_left = 293;

Y11_up = 89;
Y11_down = 250;
Y21_up = 339;

Computer the size and distance

width = X11_right - X11_left;
X_gap = X12_left - X11_right;

height = Y11_down - Y11_up;
Y_gap = Y21_up - Y11_down;

Crop and line them up in a row

lineup = [];
for i_row = 1:4
    for i_col = 1:4
        curr = slide(Y11_up + ((i_row-1)*height) + ((i_row-1)*Y_gap): Y11_up + height + ((i_row-1)*height) + ((i_row-1)*Y_gap), X11_left + ((i_col-1)*width) + ((i_col-1)*X_gap): X11_left + width + ((i_col-1)*width) + ((i_col-1)*X_gap),:);
        lineup = [lineup curr];
    end
end

Plot the lineups

figure; image(lineup);
lineup1 = lineup;

lineup_both = vertcat(lineup1,lineup);
figure; image(lineup_both);