Skip to content
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

[ENH] Remove interactivity for image centering check #1419

Merged

Conversation

NicolasGensollen
Copy link
Member

@NicolasGensollen NicolasGensollen commented Jan 22, 2025

Closes #1412

Also proposes to rename check_volume_location_in_world_coordinate_system into are_images_centered_around_origin_of_world_coordinate_system which seems closer to what the function does.

@NicolasGensollen NicolasGensollen self-assigned this Jan 22, 2025
@NicolasGensollen NicolasGensollen marked this pull request as ready for review January 22, 2025 16:30
Copy link
Contributor

@AliceJoubert AliceJoubert left a comment

Choose a reason for hiding this comment

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

Just 1 change to make. To be sure ; we are removing the question from every pipeline even when centering will be necessary due to SPM ?


return False


def _ask_for_confirmation() -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is still in check_relative_volume_location_in_world_coordinate_system which is used by pet surface and pet volume. Do you want to get rid of the question for these pipelines as well ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Absolutely, thanks for spotting that !
I don't have a strong opinion on this. The interactive mode can be turned off by explicitly adding the --yes option, but it seems that it is not necessarily obvious for users as appeared in #1412.
The function already logs a fairly detailed warning message and this interactive question doesn't bring much in my opinion, except forcing the user to read the warning and either continue or quit.
When the centering is necessary, interactive question or not, the users can still ignore this warning and launch the pipeline (it will probably just crash later in this case).
If you feel that we should keep the question, we can discuss it. Otherwise, I will indeed remove it from check_relative_volume_location_in_world_coordinate_system as you pointed out.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am fine with removing it but I would put big warnings in the documentation for the pipelines that are involved. I checked for example for T1-Freesurfer there was no mention of center-nifti or the --yes option so that was not very clear

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a note in the documentation page of T1Freesurfer in commit f0b9826. Do you think it is clear enough ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I made a small change to make it pop out a little more. I feel like this note could go in all pipelines where the option --yes was, WDYT ?

Also, if I understood correctly you still have to replace the function check_relative_volume_location_in_world_coordinate_system by the new one in pet pipelines ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I made a small change to make it pop out a little more. I feel like this note could go in all pipelines where the option --yes was, WDYT ?

Yes, good suggestions, I've accepted them. Yes, I can add this note to the other pipelines warning about centering. Will do...

Also, if I understood correctly you still have to replace the function check_relative_volume_location_in_world_coordinate_system by the new one in pet pipelines ?

I thought I did that in 3b438f6 but will double check...

Copy link
Member Author

Choose a reason for hiding this comment

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

@AliceJoubert I've updated the documentation pages of the other pipelines to have similar warning notes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@NicolasGensollen Perfect ! Sorry about the confusion in my last message you indeed changed the functions

docs/Pipelines/T1_FreeSurfer.md Outdated Show resolved Hide resolved
docs/Pipelines/T1_FreeSurfer.md Outdated Show resolved Hide resolved

return False


def _ask_for_confirmation() -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

I made a small change to make it pop out a little more. I feel like this note could go in all pipelines where the option --yes was, WDYT ?

Also, if I understood correctly you still have to replace the function check_relative_volume_location_in_world_coordinate_system by the new one in pet pipelines ?

Copy link
Contributor

@AliceJoubert AliceJoubert left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the work @NicolasGensollen


return False


def _ask_for_confirmation() -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

@NicolasGensollen Perfect ! Sorry about the confusion in my last message you indeed changed the functions

@NicolasGensollen
Copy link
Member Author

Thanks for the review @AliceJoubert !

@NicolasGensollen NicolasGensollen merged commit d08c0e7 into aramis-lab:dev Jan 24, 2025
10 of 14 checks passed
@NicolasGensollen NicolasGensollen deleted the remove-yes-from-t1-freesurfer branch January 24, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

T1-FreeSurfer requires interaction
2 participants