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

gtForwardSimulate: fixed case for no blobs in files

parent 80c49cef
No related branches found
No related tags found
No related merge requests found
......@@ -305,30 +305,30 @@ for n = first : last
difstack(:, ii, :) = spot';
end
%%% We now build the diffraction blob stack
for ii = reshape(matched, [1 numel(matched)])
[blob_vol, blob_bb] = buildBlob(spotid(ii), parameters, spotsCommProps);
% blob_vol = permute(blob_vol, [2 1 3]);
% if (fsim.assemble_figure)
% full = gtPlaceSubImage2(sum(blob_vol, 3), full, bb(ii, 1), bb(ii, 2), 'summed');
% end
% Essentially zero pads the blob to make it fit into ASTRA's
% diffraction stack
shifts_blob = getBlobStackShifts(spotsCommProps, blob_bb);
shifts = [shifts_blob.v + 1, shifts_blob.h + 1, 1];
bl(ii).intm = gtPlaceSubVolume( ...
zeros(spotsCommProps.stackVSize, spotsCommProps.stackHSize, blob_bb(6)), ...
blob_vol, shifts);
bl(ii).intm = permute(bl(ii).intm, [2 1 3]);
bl(ii).bbuim = [blob_bb(2), (blob_bb(2)+blob_bb(5)-1)];
bl(ii).bbvim = [blob_bb(1), (blob_bb(1)+blob_bb(4)-1)];
bl(ii).bbwim = [blob_bb(3), (blob_bb(3)+blob_bb(6)-1)];
bl(ii).bbsize = [blob_bb(5), blob_bb(4), blob_bb(6)];
if (isfield(parameters.seg, 'writehdf5') && parameters.seg.writehdf5)
%%% We now build the diffraction blob stack
for ii = reshape(matched, [1 numel(matched)])
[blob_vol, blob_bb] = buildBlob(spotid(ii), parameters, spotsCommProps);
% Essentially zero pads the blob to make it fit into ASTRA's
% diffraction stack
shifts_blob = getBlobStackShifts(spotsCommProps, blob_bb);
shifts = [shifts_blob.v, shifts_blob.h, 1];
% We are applying a padding of one slice (perside) on the w
% diretion
bl(ii).intm = gtPlaceSubVolume( ...
zeros(spotsCommProps.stackVSize, spotsCommProps.stackHSize, blob_bb(6)+2), ...
blob_vol, shifts);
bl(ii).intm = permute(bl(ii).intm, [2 1 3]);
blob_bb = blob_bb([2 1 3 5 4 6]);
bl(ii).bbsize = size(bl(ii).intm);
bl(ii).bbuim = [(blob_bb(1) - shifts_blob.h), (blob_bb(1) - shifts_blob.h + bl(ii).bbsize(1) - 1)];
bl(ii).bbvim = [(blob_bb(2) - shifts_blob.v), (blob_bb(2) - shifts_blob.v + bl(ii).bbsize(2) - 1)];
bl(ii).bbwim = [blob_bb(3)-1, (blob_bb(3) + blob_bb(6))];
end
end
%%% We now Build ASTRA's geometry
......
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