Skip to content

Conversation

@birajstha
Copy link
Contributor

@birajstha birajstha commented Feb 11, 2025

Fixes

Fixes UnboundLocalError: local variable 'outputs' referenced before assignment error
by @tamsinrogers and @shnizzedy

Description

Checks for if overwrite_transform switch is on while registration> using is not ANTS and reports user early to turn this switch off.

In short, allows 'overwrite_transformonly when theregistration_toolisANTS`

image

Technical details

Added conditional check in schema.py to report user that overwrite transform with same tool is not required and can turn that off.

 overwrite = partially_validated["registration_workflows"][
            "anatomical_registration"
        ]["overwrite_transform"]

        if (
            overwrite["run"]
            and "ANTS"
            not in partially_validated["registration_workflows"][
                "anatomical_registration"
            ]["registration"]["using"]
        ):
            raise ExclusiveInvalid(
                "[!] Overwrite transform is found same as the anatomical registration method! "
                "No need to overwrite transform with the same registration method."
            )

Tests

Try pipeline config with FSL as the registration tool and turning on the overwrite_transform with FSL.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I updated the changelog.
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

Copy link
Member

@shnizzedy shnizzedy left a comment

Choose a reason for hiding this comment

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

I think

  1. we want C-PAC to do the right thing if ANTS + one or more options (overwrite the transforms with the ANTs fork, not with the other forks)
  2. if we handle the validation in the schema, we don't need to handle it in the NodeBlock

@birajstha birajstha marked this pull request as ready for review March 6, 2025 23:22
Copy link
Member

@shnizzedy shnizzedy left a comment

Choose a reason for hiding this comment

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

Looks good to me, I'd just tweak the exception text a little.

Copy link
Collaborator

@sgiavasis sgiavasis left a comment

Choose a reason for hiding this comment

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

The rigidity pains my soul but we need this.
This will definitely be reassessed with the final overhaul.

@birajstha birajstha merged commit 0e954fd into many_pipes Mar 17, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants