xiangruili / dicm2nii

DICOM to NIfTI conversion, NIfTI tools
BSD 2-Clause "Simplified" License
89 stars 45 forks source link

Invalid RHS error when populating the modality column of the bids gui. #42

Closed ddwagner closed 3 years ago

ddwagner commented 3 years ago

I'm having an issue with dicom data where the sequence name contains epi (in this case epfid2d). At around like 670 dicm2nii starts parsing the sequence and setting the modality column. The specific problem comes when we get to line 689. I believe the expected behavior is to append extra strings to the current T.Modality(i) value, but is instead creating a new 1x2 categorical variable and causing an Invalid RHS error. This leads to the gui never getting shown for us to adjust bids related information prior to conversion.

I'm able to fix this by converting the current T.Modality(i) value to a proper string and then concatenating that with the additional modality related string (i.e., '_sbref' or '_bold'). I believe this is the expected behavior, but I hesitate to send a pull request before checking as this seems quite a change from the original code.

i.e., at line 692 T.Modality(i) = {[T.Modality(i) '_sbref']}; should be: T.Modality(i) = {strcat(char(T.Modality(i)),'_sbref')}

also at line 694 and 689.

Note that I didn't run into this issue previously as our older dataset sequence names didn't contain EPI and thus weren't triggering this parsing of the sequence string.

xiangruili commented 3 years ago

Thank you for noting the error. The 7/22 update fixes it as you suggested.