Skip to content

Import / tuple index slicing error on tutorial data #1

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

Open
bcmcpher opened this issue Apr 11, 2025 · 0 comments
Open

Import / tuple index slicing error on tutorial data #1

bcmcpher opened this issue Apr 11, 2025 · 0 comments

Comments

@bcmcpher
Copy link

I'm hoping to use this code to compare different implementations of freewater corrected DTI models in dataset.

However, I'm running into issues getting the code to run.

  1. I have to modify the import of the BeltramiModel to get it to run at all. I'm running __main__ if fwe.py and have to remove the . before the filename.

  2. The golub_beltrami method doesn't run. I get the following Traceback:

Traceback (most recent call last):
  File "/home/bcmcpher/Projects/fwdti/fwe-dipy/fwe/fwe/fwe.py", line 125, in <module>
    free_water_elimination(
  File "/home/bcmcpher/Projects/fwdti/fwe-dipy/fwe/fwe/fwe.py", line 36, in free_water_elimination
    fwe_image, model_params = golub_beltrami(
                              ^^^^^^^^^^^^^^^
  File "/home/bcmcpher/Projects/fwdti/fwe-dipy/fwe/fwe/fwe.py", line 64, in golub_beltrami
    model_fit = model.fit(dwi.get_fdata(), mask = mask)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bcmcpher/Projects/fwdti/fwe-dipy/fwe/fwe/beltrami.py", line 368, in fit
    f0[mask], fmin[mask], fmax[mask] = self.init_method(masked_data,
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bcmcpher/Projects/fwdti/fwe-dipy/fwe/fwe/beltrami.py", line 551, in fraction_init_hybrid
    f_MD, _, _ = fraction_init_md(signal, gtab, Diso=Diso,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bcmcpher/Projects/fwdti/fwe-dipy/fwe/fwe/beltrami.py", line 528, in fraction_init_md
    eigvals = dti_params[..., 0:3]
              ~~~~~~~~~~^^^^^^^^^^
TypeError: tuple indices must be integers or slices, not tuple

This is with the multishell dipy demo data (HBN). The dipy_fwdti runs successfully, though the optional parameters appear to be overwritten by the free water eliminated image. I'm running in a recently updated conda env with just dipy pip installed (python 3.12).

Are there specific version of dipy, etc. I need for this to work?

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

No branches or pull requests

1 participant