ReproNim / reproin

A setup for automatic generation of shareable, version-controlled BIDS datasets from MR scanners
MIT License
47 stars 13 forks source link

lists-update takes first session indicator among multiple? #68

Open yarikoptic opened 7 months ago

yarikoptic commented 7 months ago

we ran into a situation

bids@rolando:/inbox/BIDS/Wager/Wager/1076_spacetop$ ls -l /inbox/DICOM/2021/12/16/A004300 | grep 00.*cout
drwxr-x--- 2 193119 wager  130 Dec 16  2021 001-anat-scout_ses-01
drwxr-x--- 2 193119 wager  130 Dec 16  2021 001-anat-scout_ses-02
drwxr-x--- 2 193119 wager    7 Dec 16  2021 002-anat-scout_ses-01_MPR_sag
drwxr-x--- 2 193119 wager    7 Dec 16  2021 002-anat-scout_ses-02_MPR_sag
drwxr-x--- 2 193119 wager    5 Dec 16  2021 003-anat-scout_ses-01_MPR_cor
drwxr-x--- 2 193119 wager    5 Dec 16  2021 003-anat-scout_ses-02_MPR_cor
drwxr-x--- 2 193119 wager    5 Dec 16  2021 004-anat-scout_ses-01_MPR_tra
drwxr-x--- 2 193119 wager    5 Dec 16  2021 004-anat-scout_ses-02_MPR_tra

and rightfully two records in lists

bids@rolando:/inbox/BIDS/Wager/Wager/1076_spacetop$ grep -A1 'A004300.*[0-9]$' /inbox/BIDS/reproin/lists/*
/inbox/BIDS/reproin/lists/202112xx.txt:/inbox/DICOM/2021/12/16/A004300/001-anat-scout_ses-01
/inbox/BIDS/reproin/lists/202112xx.txt- StudySessionInfo(locator='Wager/Wager/1076_spacetop', session='01', subject='XXX') 1 sequences study hash: 2ce5bbe14ca90fa7a5c26c55abc0d3d4
/inbox/BIDS/reproin/lists/202112xx.txt:/inbox/DICOM/2021/12/16/A004300/001-anat-scout_ses-02
/inbox/BIDS/reproin/lists/202112xx.txt- StudySessionInfo(locator='Wager/Wager/1076_spacetop', session='02', subject='XXX') 1 sequences study hash: 2ce5bbe14ca90fa7a5c26c55abc0d3d4

but then when we convert I think we take only first one and this time we simply skipped this accession since ses-01 was already converted

So we should be more careful in such cases, although not yet sure how ;-)