You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several tools along the hMRI toolbox pipeline were written under the expectation that the input data would always be integer-type nifti files. This means that several shortcuts were taken (e.g. here) which become invalid for input data which have magnitudes in the range [0, 1].
Workaround
Scale all of the input data by some large factor (e.g. 1000 or 10000) before putting them into the toolbox pipeline. This can be done using e.g. spm_calc or fslmaths. Note that such tools often overwrite the descrip field of the nifti file, and so it is strongly advised to use sidecar json files containing the protocol details (with the same base-name as the newly-scaled data) rather than relying on the descrip field.
The text was updated successfully, but these errors were encountered:
I think that scaling only can be dangerous because it might introduce ceiling effects for other data (data format).
A simple solution to solve both problems could be to plug a normalization function (see what we use in acid_hysco below) before the thresholding step in line data = max(data, 1);
---- Example normalisation function ----
function [I1,I2] = normalizeIntensities(I1,I2)
% =========================================================================
% function [I1,I2] = normalizeIntensities(I1,I2
%
% normalizes intensities to the range of [0, 256]
%
% Inputs:
% I1,I2 - image data with intensity range [mini, maxi]
%
% Outputs:
% I1,I2 - image data with intensity range [0, 256]
% =========================================================================
mini = min(min(I1(:)),min(I2(:)));
I1 = I1 - mini;
I2 = I2 - mini;
maxi = max(max(I1(:)),max(I2(:)));
I1 = (256/maxi)*I1;
I2 = (256/maxi)*I2;
end
Thanks for the suggestion @siawoosh. However I can imagine scenarios where this could get problematic, e.g. if a non-linear deformation had been applied to the image before being input into the toolbox and so there are very positive or very negative voxels. Probably there are ways to guess reasonable min and max values from the data (e.g. percentiles) which would be less affected by these outliers, but they could still go wrong. Perhaps we should provide a rescaling function ourselves where the user can specify the min and max values to be scaled?
Description of problem
Several tools along the hMRI toolbox pipeline were written under the expectation that the input data would always be integer-type nifti files. This means that several shortcuts were taken (e.g. here) which become invalid for input data which have magnitudes in the range
[0, 1]
.Workaround
Scale all of the input data by some large factor (e.g. 1000 or 10000) before putting them into the toolbox pipeline. This can be done using e.g.
spm_calc
orfslmaths
. Note that such tools often overwrite thedescrip
field of the nifti file, and so it is strongly advised to use sidecar json files containing the protocol details (with the same base-name as the newly-scaled data) rather than relying on thedescrip
field.The text was updated successfully, but these errors were encountered: