Fixes #611 Participants.tsv -> participants.tsv#749
Conversation
|
@jan-petr: The way I wrote this in cb286d9 it basically works for that individual script, but that's not really how we should do this. Maybe we should rather revert cb286d9 and do this regexp check ... subjectNameOld = subjectName;
if isempty(regexp(subjectNameOld,'sub-')==1)
subjectName = ['sub-' subjectNameOld];
fprintf('Change subject name: %s -> %s\n',subjectNameOld,subjectName);
end... at the beginning of the pipeline and use it to rename the overall dataset. Otherwise you will always suffer from subsequent faults like these ones ... Printing csv-files with volume statistics...100%
Change subject name: 109 -> sub-109
Change subject name: 109 -> sub-109
Change subject name: 109 -> sub-109
Change subject name: 109 -> sub-109
Change subject name: 109 -> sub-109
Change subject name: 109 -> sub-109
Change subject name: 109 -> sub-109
050_GetVolumeStatistics was performed
Collecting motion metadata with motion statistics:100%
Saving motion plot to .\Siemens_2DEPI_noBsup_FLAIR_LoQ\Population\MotionASL\Overview_motion_pair-exclusion.jpg
Change subject name: 109 -> sub-109
060_GetMotionStatistics was performed
Loading & saving individual parameter files...100%
065_GetRegistrationStatistics was performed
participants.tsv (BIDS) detected, loading...
Loading AcquisitionTime:100%
Variable AcquisitionTime not included because all subjects were missing
Loading GM_vol:100%
Variable GM_vol not included because all subjects were missing
Loading WM_vol:100%
Variable WM_vol not included because all subjects were missing
Loading CSF_vol:100%
Variable CSF_vol not included because all subjects were missing
Loading GM_ICVRatio:100%
Variable GM_ICVRatio not included because all subjects were missing
Loading GMWM_ICVRatio:100%
Variable GMWM_ICVRatio not included because all subjects were missing
Loading WMH_vol:100%
Variable WMH_vol not included because all subjects were missing
Loading WMH_count:100%
Variable WMH_count not included because all subjects were missing
Loading MeanMotion:100%
Variable MeanMotion not included because all subjects were missing |
|
Move this ... if isempty(regexp(subjectName ,'sub-')==1)
subjectName = ['sub-' subjectName ];
fprintf('Change subject name: %s -> %s\n',subjectNameOld,subjectName);
end... to the import (in a separate issue?). |
jan-petr
left a comment
There was a problem hiding this comment.
Minor fixes needed. otherwise looks good.
| PathTSV = fullfile(x.D.ROOT, 'Participants.tsv'); | ||
| PathTSV = fullfile(x.D.ROOT, 'participants.tsv'); | ||
| PathTSVold = fullfile(x.D.ROOT, 'Participants.tsv'); | ||
| bParticipantsTSV = false; |
There was a problem hiding this comment.
to me, it is better to rename it if it detects the old one...
There was a problem hiding this comment.
You're right. That's probably the more straight forward way to do this.
2b189c8 👍
There was a problem hiding this comment.
thanks for the edit. Same as above - do we need the temp? Should we check for existence of both
| bParticipantsTSV = true; | ||
| end | ||
|
|
||
| if bParticipantsTSV |
There was a problem hiding this comment.
especially since the 'participatns.tsv' is reported here.
| % bUpdateMetadata - boolean specifying if we reload the metadata, e.g. | ||
| % for potentially other defined cohorts etc in the | ||
| % Participants.tsv. This can some time though. Only relevant when computing multiple sets. | ||
| % participants.tsv. This can some time though. Only relevant when computing multiple sets. |
There was a problem hiding this comment.
"this can take some time" :D
cb286d9 to
b30ab8f
Compare
|
Okay, minor problem... file names are not case sensitive on windows... |
| PathTSV = fullfile(x.D.ROOT, 'Participants.tsv'); | ||
| PathTSV = fullfile(x.D.ROOT, 'participants.tsv'); | ||
| PathTSVold = fullfile(x.D.ROOT, 'Participants.tsv'); | ||
| bParticipantsTSV = false; |
There was a problem hiding this comment.
thanks for the edit. Same as above - do we need the temp? Should we check for existence of both
jan-petr
left a comment
There was a problem hiding this comment.
OK to merge after the 2 comments are added.
The previous code did not work because windows will complain if you move Participants.tsv to participants.tsv, since it regards both as the same file. The easiest fix is to rename it to another filename temporarily in between. Additionally we had the problem that you can not find the lowercase/uppercase differences using exist or xASL_exist, but xASL_adm_GetFileList uses regular expressions and worked nicely, so I implemented a fix with that. Makes the code a bit clunky though.
…participants.tsv
fe42f18 to
f179125
Compare

Linked issue
Check out #611
How to test
Run test dataset in BIDS format with old and new
participants.tsv/Participants.tsv