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

using MITTENS #11

Open
vnbcs opened this issue Apr 14, 2023 · 7 comments
Open

using MITTENS #11

vnbcs opened this issue Apr 14, 2023 · 7 comments

Comments

@vnbcs
Copy link

vnbcs commented Apr 14, 2023

Hello! I am trying to use MITTENS and running into a number of errors.

I successfully converted the Dockerfile into Singularity and attempted it to build it. It ran into issues with cmake (I think, the errors were quite long) and did not complete set up. So I am running it locally on an Ubuntu server (20.04.5 LTS).

I am using Python 3.10, so I updated the now-depreciated numpy functions accordingly (np.float -> np.float64). After updating numpy functions and installing dependencies, I attempted to run the setup.py file. This did not run, due to errors with distutils/numpy.distutils. I wasn't sure if running this file was necessary, so I then tried to run the code in the readme.

from mittens import MITTENS
mitns = MITTENS(reconstruction="subj-id_dwi.odf.gqi.1.25.fib.gz")

This returns the error:

ModuleNotFoundError: No module named 'mittens.fortran'

I decided to try running this code first, since it creates Fortran files:

from mittens.write_solution import write_solution
write_solution("odf8", 35, 1.0)

First, there is no function write_solution in mittens/write_solution.py. I assume you meant write_files? When I run this with write_files, I get back this error:

compatible_indices = np.array([np.flatnonzero(r) for r in compatible_angles])
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (642,) + inhomogeneous part.

Let me know if I can provide any additional details. Thanks so much.

@mattcieslak
Copy link
Owner

hi @vnbcs, could you try building the singularity image directly from dockerhub like

singularity build mittens.sif docker://pennbbl/mittens:latest

This should produce a working image, but please let me know if otherwise

@vnbcs
Copy link
Author

vnbcs commented Apr 14, 2023

That worked! I am now running Python3.7 in the Singularity shell. I am trying write_files("odf-8", 35, 1). According to tqdm, it will be processing for the next hour. I will update you on the results. Thanks!

@mattcieslak
Copy link
Owner

Excellent! MITTENS is a favorite project of mine that hasn't seen much interest, let me know if you have questions about its outputs or use

@vnbcs
Copy link
Author

vnbcs commented Apr 19, 2023

Hello again! write_files("odf-8", 35, 1) ran, and I moved the fortran files into src. I tried to install the package with pip install -e ., but received an error saying the package was already installed. I once again ran the following code, this time in the Singularity shell.

from mittens import MITTENS
fn ='/path_goes_here/subj-id_dwi.odf.gqi.1.25.fib.gz'
mitns = MITTENS(reconstruction=fn)

And again I got back a module not found error. There is still no folder mittens/fortran. Here's the full traceback:

>>> mitns = MITTENS(reconstruction=fn)
INFO:mittens._mittens:
Using
------
  Step Size:            0.8660 Voxels 
  ODF Resolution:       odf8
  Max Angle:            35.00 Degrees
  Angle Weights:        flat
  Angle weight power:   1.0
INFO:mittens.external.dsi_studio:Loading DSI Studio ODF data
WARNING:mittens.external.dsi_studio:Unable to load real affine image 
INFO:mittens._mittens:Loaded ODF data: (209526, 321)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/path_goes_here/MITTENS/mittens/_mittens.py", line 177, in __init__
    self._initialize_nulls()
  File "/path_goes_here/MITTENS/mittens/_mittens.py", line 187, in _initialize_nulls
    self.singleODF_funcs = self.get_prob_funcs("singleODF")
  File "/path_goes_here/MITTENS/mittens/_mittens.py", line 290, in get_prob_funcs
    module = importlib.import_module("mittens.fortran." + requested_module)
  File "/usr/local/miniconda/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mittens.fortran'

What do you recommend? Thanks again!

@jlhanson5
Copy link

I'm less familiar with MITTENS, but I'm helping @vnbcs out (and I am semi-familiar with DWI). Any thoughts on the issues that we were running into? Anyone else run into these errors?

@mattcieslak
Copy link
Owner

I wonder if this is a docker/singularity issue. Would you be interested in screen-sharing to debug some time later this week?

@vnbcs
Copy link
Author

vnbcs commented May 4, 2023

that would be great! you can email me at e.bacas@pitt.edu

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

3 participants