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

[BUG] (solution provided!) HCPex atlas does not produce Left V1 ROI due to wrong LUT reading in `getLookUpTable.m` #117

Closed JacMatu closed 6 months ago

JacMatu commented 6 months ago

Is there an existing issue for this?

Expected Behavior

I expected to build a V1 ROI from hcpex with

opt.roi.hemi = {'L', 'R'};
opt.roi.atlas = 'HCPex';
opt.roi.name = 'V1';

bidsCreateROI(opt);

Current Behavior

L_V1 is not listed as an available ROI even though it exists in the look-up table (CPP_ROI/atlas/HCpex/HCPex_v1.0/HCPex.nii.txt) line 1: 1 L_V1 1

Error message

No response

Environment

- OS:
- Matlab:
- SPM:

Branch

- branch:
- version: v0.3.1

Anything else?

ERROR REASON: getLookUpTable.m with 'hcpex' atlas skips first row of the text file when looking up ROI labels and names

case 'hcpex'

      roiLabelLUT = fullfile(atlasDir, 'HCPex.nii.txt');

      fid = fopen(roiLabelLUT);
      pattern = '%f%s%s%f';
      C = textscan(fid, pattern, 'Headerlines', 1);

SOLUTION: Change C = textscan(fid, pattern, 'Headerlines', 1); to 0 to avoid skipping first line

So this will work with V1 ROI: C = textscan(fid, pattern, 'Headerlines', 0;

Remi-Gau commented 6 months ago

@JacMatu do feel like opening a pull request to fix this?

Remi-Gau commented 6 months ago

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

allcontributors[bot] commented 6 months ago

@Remi-Gau

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