Closed suheyla2 closed 4 years ago
If there are dots in the subject id, parcellation becomes wrong.
I haven't seen any subject ID that contains .
in it. Hence the software was designed this way.
My suggestion is searching the substrings '.nii' or '.nii.gz' instead of '.' to find the index.
This would be a long shot given there are many places in the software we find path prefix (absolute path until .
) and name prefix (relative path until .
). Moreover, .nii
and .nii.gz
search isn't enough given the software also supports .nrrd
and .nhdr
formats. So encompassing all cases should bring cumbersomeness all through the software.
My counter suggestion would be to replace .
with _
in any subject ID and corresponding file names.
Can you please add this as a note so that users can be aware of it? Thanks!
Yes. Good idea to at-least add a note.
Yogesh
On Jan 16, 2020, at 12:22 PM, suheyla2 notifications@github.com<mailto:notifications@github.com> wrote:
External Email - Use Caution
Can you please add this as a note so that users can be aware of it? Thanks!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/pnlbwh/dMRIharmonization/issues/44?email_source=notifications&email_token=ABNK3IM6TAERN4XT2C2WTLDQ6CJVPA5CNFSM4KHVZD4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJE3PQQ#issuecomment-575256514, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNK3INVYKUF75REVRPNZ4TQ6CJVPANCNFSM4KHVZD4A.
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Can you please add this as a note so that users can be aware of it? Thanks!
Yes, I can add a note on the https://github.com/pnlbwh/dMRIharmonization/wiki
On the other hand, thinking about the possibility of a modification, can you give me an example project to look at where subjects have .
in their names?
Please see the subjects in this list: /rfanfs/pnl-zorro/home/yogesh/Data/TravelSubGermany/SKYRA_CMRR_reference.txt
Okay, let's take your opinion on the correction. How do you like the revised logic below:
from os.path import dirname, basename
# absolute path until extension, valid for both .nii and .nii.gz
inPrefix= imgPath.split('.nii')[0]
# name prefix
prefix= basename(inPrefix)
# directory
directory= dirname(inPrefix)
As noted earlier, inPrefix
, prefix
, and directory
are found like above in many places throughout the software.
I think this is a good way, thank you! I guess nrrd files would also work since you are converting them to nifti?
I guess nrrd files would also work since you are converting them to nifti?
Yes, I realized later.
The current code assumes that data paths do not contain any dots ('.') in the path except the file extension, but this might not be true in general. If there are dots in the subject id, parcellation becomes wrong. My suggestion is searching the substrings '.nii' or '.nii.gz' instead of '.' to find the index.