Closed kcho closed 3 years ago
It could also be the case that other teams may add extra subdirectories under box and mediaflux as well. To account for this extra level of directories under the datatype directory
In regard to your description, I am trying to understand the need for this new code:
The above code correctly detects processed, study, subject, and data groups for both beginning and ending extra paths:
file_path="/Some/Path/EXTRA/PROTECTED/BWH/raw/subject01/actigraphy/file"
In [98]: search.group('processed')
Out[98]: 'raw'
In [99]: search.group('study')
Out[99]: 'BWH'
In [100]: search.group('dtype')
Out[100]: 'actigraphy'
In [101]: search.group('subject')
Out[101]: 'subject01'
file_path="/Some/Path/to/PROTECTED/BWH/raw/subject01/actigraphy/EXTRA/file"
In [105]: search.group('subject')
Out[105]: 'subject01'
In [106]: search.group('dtype')
Out[106]: 'actigraphy'
In [107]: search.group('study')
Out[107]: 'BWH'
In [108]: search.group('processed')
Out[108]: 'raw'
Did you observe the same? If yes, the description should be updated as:
It could also be the case that other teams may add extra subdirectories under box/mediaflux and datatype directories. To account for this extra level of beginning and ending directories ...
It's to support extra folders under the datatype root directory, which is already the case for the data pulled by XNAT.
eg) lochness.XNAT
puts another folder under mri
, eg) raw/subject01/mri/2001_MR
.
Doc string has been updated to add a little more elaboration b31a9f3
Please consider merging my suggestion #16 and we are good to go. Thank you.
Merged. Thanks
I have noticed that
lochness.XNAT
module will download data to a subdirectory (eg- 2001_MR1) undermri
directory in the phoenix structure. It could also be the case that other teams may add extra subdirectories underbox
andmediaflux
as well. To account for this extra level of directories under the datatype directory, I've updatedFileInPhoenixBIDS
andFileInPhoenix
classes to use regrex to be more flexible under these situations. Tested usingpytest test/dpanonymize/test_dpanonymize.py
.Thanks.