-
Notifications
You must be signed in to change notification settings - Fork 52
[MRI] Check if CenterID and MRI_Alias are defined before going further #1228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The Although that is Perl code so anything is fine with me. |
@maximemulder you make a good point actually for the database check. And is there a python equivalent to this code that I should be editing too ? |
@ridz1208 Now that I think about it. If you add a database check, there is no reason for the configuration to specify both the site ID and the site MRI alias. Just specify the site ID and get the MRI alias from the database. Technically there is some equivalent code in the Python DICOM to BIDS scripts here. Note that the logic is not exactly the same, and I don't think the whole script can work if the session is I assume this site configuration feature is new (at least in main) ? It is currently not present in this file that defines the structure of the Python subject information configuration ( To give my more general and long term impression on that code. I don't like the way the subject information configuration is handled in Python. The |
I couldnt agree more, see my first PR on LORIS MRI #1227
It's not new per-say, the prod file used by perl allows me to define whatever I want in the subjectIDref and I decided to mod my prod file to do the database check for the site there because I don't consider it done properly in the rest of the code (i.e. too broad preg matches with high risk of false positives) its a mix of having to do it as an override and not wanting to mess with existent behaviour at the same time. As for modifying the python side. Initially I had only found the
As for the long term direction... I can't really speak to it. I think there is a very wide range of naming conventions out there and it would be very hard to make a single system that handles all of them whether its in the Perl or python code. On CBIG I try to be as explicit as possible so generally for patient scans I rely as much as possible on the identifiers, for phantoms I ask that the name contain the site, project and visit to avoid any implicitely deduced parameters anywhere... I'm fairly new to these pipeline so i'm sure there is a cleaner way to do it but the question will be how disruptive they would be to existent projects |
I reviewed #1227. I agree on the broad regex matches and potential false positives in the code. Thanks for sharing your config. I am pretty sure that as of LORIS-MRI 26 / main, the field "CenterID" in the Python configuration is not supported (and thus ignored). As per the function I posted earlier, the scan site is first gotten from the session, or if no session is found (but I don't see how the code can work then, I need to investigate deeper to be sure), from the site alias or MRI alias. Also, this configuration is only used by the LORIS DICOM to BIDS pipeline for now. If this meets your needs, do not change the Python configuration for now IMO. I may do it myself in the coming months. If you're interested in my current LORIS-MRI to-do list, it is the following:
Though keep in mind that I have now a new full-time job (or rather PhD). So this last task may depend on my availability. |
Good to know , I'll change it back. I made the assumption that it works like the perl code
I'm guessing that was designed to mimic the perl code but I have the same problem as you. I'm not getting the 100% certainty that if a user makes a mistake it wont go rogue and try to pattern match the MRI alias from the patient name (That's really not a functionality I want) and the way it makes it past the session check in the perl code at least is if we are dealing with phantom scans and not patient scans. This is basically the reason for my PR, instead of defaulting to a case which may or may not result in a false positive (here)[https://github.com/aces/Loris-MRI/blob/main/uploadNeuroDB/NeuroDB/MRI.pm#L1122] I'm getting the CenterID myself in the prod file and adding this code to bypass the function entirely (really not ideal but safest change to not breake other projects I assumed) Like I said I think the issue stems from the lack of consistency and standardization accross projects... you cant make a function to pattern match for a site alias when there is no specific convention where to look. Here is the code I out in my prod file which reduces false positives by pattern matching specific locations to specific entities
|
Okay, thanks for the additional context ! That comforts me in my opinion:
FYI, I discussed with Cécile a few months ago and the impression is that the Python configuration was written by mimicking the Perl configuration but that phantoms are generally untested in Python, and might thus be broken. |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 20 days. |
No description provided.