Skip to content
Snippets Groups Projects
Commit 6dcb265c authored by Nicola Vigano's avatar Nicola Vigano
Browse files

gtGetRawRoi: made it possible to load images outside the [0, num_images-1] boundaries, by wrapping

parent 00a8329e
No related branches found
No related tags found
No related merge requests found
...@@ -47,7 +47,7 @@ function bl = gtFwdSimBuildDifstackBlobs(blobids, indexes, parameters, stackUSiz ...@@ -47,7 +47,7 @@ function bl = gtFwdSimBuildDifstackBlobs(blobids, indexes, parameters, stackUSiz
shifts_blob = gtFwdSimGetStackShifts(stackUSize, stackVSize, blob_bb, false); shifts_blob = gtFwdSimGetStackShifts(stackUSize, stackVSize, blob_bb, false);
shifts = [shifts_blob.u, shifts_blob.v, 1]; shifts = [shifts_blob.u, shifts_blob.v, 1];
% We are applying a padding of one slice (perside) on the w % We are applying a padding of one slice (per side) on the w
% diretion % diretion
blob_size_im = [stackUSize, stackVSize, blob_bb(6)+2]; blob_size_im = [stackUSize, stackVSize, blob_bb(6)+2];
blob_bb_im = [blob_bb(1:3) - shifts, blob_size_im]; blob_bb_im = [blob_bb(1:3) - shifts, blob_size_im];
......
...@@ -2,6 +2,9 @@ function [spot, m] = gtGetRawRoi(start_image, end_image, acq, bb) ...@@ -2,6 +2,9 @@ function [spot, m] = gtGetRawRoi(start_image, end_image, acq, bb)
% GETRAWROI Sums a roi in raw images % GETRAWROI Sums a roi in raw images
% [spot, m] = gtGetRawRoi(start_image, end_image, acq, bb) % [spot, m] = gtGetRawRoi(start_image, end_image, acq, bb)
p = struct('acq', acq);
tot_images = gtGetTotNumberOfImages(p);
nimages = end_image - start_image + 1; nimages = end_image - start_image + 1;
spot = zeros(bb(4), bb(3), nimages); spot = zeros(bb(4), bb(3), nimages);
m = zeros(nimages, 1); m = zeros(nimages, 1);
...@@ -11,7 +14,7 @@ function [spot, m] = gtGetRawRoi(start_image, end_image, acq, bb) ...@@ -11,7 +14,7 @@ function [spot, m] = gtGetRawRoi(start_image, end_image, acq, bb)
% was < acq.xdet and < acq.ydet % was < acq.xdet and < acq.ydet
if all([bb(1) > 0, bb(2) > 0, bb(1)+bb(3) <= acq.xdet, bb(2)+bb(4) <= acq.ydet]) if all([bb(1) > 0, bb(2) > 0, bb(1)+bb(3) <= acq.xdet, bb(2)+bb(4) <= acq.ydet])
fullImgsDir = fullfile(acq.dir, '1_preprocessing', 'full'); fullImgsDir = fullfile(acq.dir, '1_preprocessing', 'full');
indexes = start_image : end_image; indexes = mod(start_image : end_image, tot_images);
filename = fullfile(fullImgsDir, sprintf('full%04d.edf', indexes(1))); filename = fullfile(fullImgsDir, sprintf('full%04d.edf', indexes(1)));
info = edf_info(filename); info = edf_info(filename);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment