Skip to content

Fixes #611 Participants.tsv -> participants.tsv#749

Merged
MichaelStritt merged 7 commits intodevelopfrom
bids-#611_participants
Jul 30, 2021
Merged

Fixes #611 Participants.tsv -> participants.tsv#749
MichaelStritt merged 7 commits intodevelopfrom
bids-#611_participants

Conversation

@MichaelStritt
Copy link
Contributor

@MichaelStritt MichaelStritt commented Jul 29, 2021

Linked issue

Check out #611

How to test

Run test dataset in BIDS format with old and new participants.tsv / Participants.tsv

@MichaelStritt MichaelStritt added the bids Moving ExploreASL to BIDS compatibility label Jul 29, 2021
@MichaelStritt MichaelStritt requested a review from jan-petr July 29, 2021 09:24
@MichaelStritt MichaelStritt self-assigned this Jul 29, 2021
@MichaelStritt MichaelStritt linked an issue Jul 29, 2021 that may be closed by this pull request
@MichaelStritt
Copy link
Contributor Author

@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

@MichaelStritt
Copy link
Contributor Author

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?).

Copy link
Contributor

@jan-petr jan-petr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to me, it is better to rename it if it detects the old one...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. That's probably the more straight forward way to do this.
2b189c8 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the edit. Same as above - do we need the temp? Should we check for existence of both

bParticipantsTSV = true;
end

if bParticipantsTSV
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

especially since the 'participatns.tsv' is reported here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2b189c8 👍

% 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"this can take some time" :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b30ab8f 👍

@MichaelStritt MichaelStritt force-pushed the bids-#611_participants branch from cb286d9 to b30ab8f Compare July 30, 2021 07:11
@MichaelStritt
Copy link
Contributor Author

Okay, minor problem... file names are not case sensitive on windows...

@MichaelStritt
Copy link
Contributor Author

Test with existing (old) Participants.tsv within the BIDS root directory

It perfectly renamed, moved and filled it:

image

@MichaelStritt MichaelStritt requested a review from jan-petr July 30, 2021 08:34
Copy link
Contributor

@jan-petr jan-petr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there :)

PathTSV = fullfile(x.D.ROOT, 'Participants.tsv');
PathTSV = fullfile(x.D.ROOT, 'participants.tsv');
PathTSVold = fullfile(x.D.ROOT, 'Participants.tsv');
bParticipantsTSV = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the edit. Same as above - do we need the temp? Should we check for existence of both

@MichaelStritt MichaelStritt requested a review from jan-petr July 30, 2021 10:44
Copy link
Contributor

@jan-petr jan-petr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@MichaelStritt MichaelStritt force-pushed the bids-#611_participants branch from fe42f18 to f179125 Compare July 30, 2021 10:57
@MichaelStritt MichaelStritt merged commit f179125 into develop Jul 30, 2021
@MichaelStritt MichaelStritt deleted the bids-#611_participants branch July 30, 2021 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bids Moving ExploreASL to BIDS compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Participants.tsv in BIDS format

2 participants