Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add conditional statement #271

Merged
merged 6 commits into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions matlab/ecat2nii.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@

% save raw data
if savemat
ecat = img_temp.*(Sca*mh.ecat_calibration_factor);
if mh.calibration_units == 1 % see line 337
ecat = img_temp.*Sca;
else
ecat = img_temp.*(Sca*mh.ecat_calibration_factor);
end
save([filenameout '.ecat.mat'],'ecat','-v7.3');
end

Expand Down Expand Up @@ -330,7 +334,13 @@
warning('the json file is BIDS invalid')
end

img_temp = single(round(img_temp).*(Sca*mh.ecat_calibration_factor));
if mh.calibration_units == 1 % do calibrate
img_temp = single(round(img_temp).*(Sca*mh.ecat_calibration_factor)); % scale and dose calibrated
warning('it looks like the source data are not dose calibrated - ecat2nii is thus scaling the data')
else % do not calibrate
img_temp = single(round(img_temp).*Sca); % just the 16 bit scaling, img_temp is already dose calibrated
warning('it looks like the source data are already dose calibrated - ecat2nii is thus not scaling the data')
end
info.Datatype = 'single';
info.BitsPerPixel = 32;
info.SpaceUnits = 'Millimeter';
Expand Down
Loading