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

WIP: Bval error check #1133

Closed
wants to merge 3 commits into from
Closed

Conversation

teresamg
Copy link
Contributor

@teresamg teresamg commented May 2, 2024

Checks if dki is specified when there are less than three bvals

@36000
Copy link
Collaborator

36000 commented May 9, 2024

I wonder if this could be a lot less lines of code if you do this check in dki_params. If you don't want to do this because you want the error to happen during initialization of ParticipantAFQ, not runtime during and export call, you could move it to get_data_plan. At line 1024, there is already this check for defaults:

    if "scalars" not in kwargs:
        bvals, _ = read_bvals_bvecs(kwargs["bval_file"], kwargs["bvec_file"])
        if len(dpg.unique_bvals_magnitude(bvals)) > 2:
            kwargs["scalars"] = [
                "dki_fa", "dki_md",
                "dki_kfa", "dki_mk"]
        else:
            kwargs["scalars"] = [
                "dti_fa", "dti_md"]

You could do something similar nearby. That way its with the data code and not in the participantAFQ code (just the way I have been organizing things).

@36000 36000 mentioned this pull request May 20, 2024
@36000
Copy link
Collaborator

36000 commented May 20, 2024

I think this will get the job done: #1139

@36000 36000 closed this May 20, 2024
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.

None yet

2 participants