Commit 10bd9284 authored by Christian Brabetz's avatar Christian Brabetz
Browse files

fix for odd frame sizes. Closes #1.

parent e207eceb
......@@ -445,11 +445,9 @@ end
set(handles.xmask,'Enable','Off');
set(handles.ymask,'Enable','Off');
% xcenter=handles.xcenter;
xcenter = str2double(get(handles.xcentermask,'String'));
xcenter = int64(handles.xcenter);
dx=int64(handles.dxmask);
% ycenter=handles.ycenter;
ycenter = str2double(get(handles.ycentermask,'String'));
ycenter = int64(handles.ycenter);
dy=int64(handles.dymask);
if ~isfield(data.data, 'ImageArray_cut')
data.data.ImageArray_cut = zeros(dy, dx, 4, length(data.parameters.rcffiles), 'uint16'); % 16bit/channel and files
......@@ -457,12 +455,12 @@ elseif size(data.data.ImageArray_cut,1) ~= dy || size(data.data.ImageArray_cut,2
data.data.ImageArray_cut = zeros(dy, dx, 4, length(data.parameters.rcffiles), 'uint16'); % 16bit/channel and files
end
dylow=floor(dy/2);
dyup=ceil(dy/2);
dxlow=floor(dx/2);
dxup=ceil(dx/2);
data.data.ImageArray_cut(:,:,1:3,handles.currentRCFframe)=data.data.ImageArray(ycenter-dylow+1:ycenter+dyup,xcenter-dxlow+1:xcenter+dxup,1:3,handles.currentRCFframe);
data.data.ImageArray_cut(:,:,4,handles.currentRCFframe)=data.data.ImageArray(ycenter-dylow+1:ycenter+dyup,xcenter-dxlow+1:xcenter+dxup,4,handles.currentRCFframe);
dylow=ycenter-floor(dy/2);
dyup=dylow+dy-1;
dxlow=xcenter-floor(dx/2);
dxup=dxlow+dx-1;
data.data.ImageArray_cut(:,:,1:3,handles.currentRCFframe)=data.data.ImageArray(dylow:dyup,dxlow:dxup,1:3,handles.currentRCFframe);
data.data.ImageArray_cut(:,:,4,handles.currentRCFframe)=data.data.ImageArray(dylow:dyup,dxlow:dxup,4,handles.currentRCFframe);
plotrcf(data.data.ImageArray_cut,handles);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment