cpp-lln-lab / CPP_ROI

Set of Octave and Matlab functions, demos and scripts to help manage ROIs and to play nice with BIDS datasets. Mostly volume-based and SPM centric.
https://cpp-roi.readthedocs.io/en/latest/index.html
GNU General Public License v3.0
5 stars 6 forks source link

atlas from Anatomy toolbox v3.0 doesn't work well with cpp_roi #92

Open yyang1234 opened 1 year ago

yyang1234 commented 1 year ago

Hi, I try to use atlas from Anatomy toolbox v3.0--->ROI tool and cpp-roi to create individual rois.

After prepareDataAndROI step when using createRoi('expand) to create a roi, an error occurs said that the image:../src/inputs/JuBrain_ROIs/space-MNI_label-leftAG_desc-p00pt00_mask.nii must be a binary image. It seems to more than ones and zeros. Error in createRoi (line 174) isBinaryMask(roiImage);

But this mask should be a binary mask because it has already been binarised using thresholdToMask. After checking with isBinaryMask.m, I found that the mask is binarised as [0, 1.000] instead of [0, 1]. As isBinaryMask.m only considers a mask contain [0,1] as a binary mask, an error occurs.

It might related to the data type of atlas from Anatomy toolbox? checked atlas with spm_vol found that it was in int16 format. If rewrite it with float64, above mentioned error disappeared.

Remi-Gau commented 8 months ago

@all-contributors please add @yyang1234 for bug, userTesting

allcontributors[bot] commented 8 months ago

@Remi-Gau

I've put up a pull request to add @yyang1234! :tada: