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

TypeError: object of type 'float' has no len() #401

Closed
Samuel-Maddox opened this issue Apr 11, 2024 · 6 comments
Closed

TypeError: object of type 'float' has no len() #401

Samuel-Maddox opened this issue Apr 11, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@Samuel-Maddox
Copy link

Details

Hello, I just want to say that I am new to ASL data, so apologies if I have made any basic errors.

I am trying to process some PASL data through aslprep. This data has already had freesurfer recon-all run, and I am attempting to use the freesurfer subject directories to speed up processing by passing '--fs-subjects-dir ${fs_dir}/'. My first try, I ran into the bug that was recently reported in: #398.

I then attempted to re-run the command with '--fs-no-reconall' flag included in hope that it would use the fs data passed with '--fs-subjects-dir'. Is this the correct way run ASLprep with recon-all already processed? After some time, I then got the errors shown below.

Could this be to do with the way BolusCutOffDelayTime is defined in my BIDS dataset? I could have made some errors when doing the BIDS conversions perhaps as this is new to me.. but it did pass the BIDS validator.

Do let me know if you have any advice or need more info - any help is appreciated! :)

Additional details

  • ASLPrep version: v0.6.0
  • Singularity version: 3.6.0-rc.4+67-gca233ae

Traceback

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 344, in _send_procs_to_workers
    self.procs[jobid].run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node compute_cbf.

Traceback:
	Traceback (most recent call last):
	  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 397, in run
	    runtime = self._run_interface(runtime)
	  File "/usr/local/miniconda/lib/python3.10/site-packages/aslprep/interfaces/cbf.py", line 567, in _run_interface
	    assert len(metadata["BolusCutOffDelayTime"]) == 2
	TypeError: object of type 'float' has no len()

...


Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node determine_bolus_duration.

Traceback:
	Traceback (most recent call last):
	  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 397, in run
	    runtime = self._run_interface(runtime)
	  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/interfaces/utility/wrappers.py", line 142, in _run_interface
	    out = function_handle(**args)
	  File "<string>", line 25, in get_bolus_duration
	TypeError: 'float' object is not subscriptable
...


ASLPrep failed: Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node determine_bolus_duration.

Traceback:
	Traceback (most recent call last):
	  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 397, in run
	    runtime = self._run_interface(runtime)
	  File "/usr/local/miniconda/lib/python3.10/site-packages/nipype/interfaces/utility/wrappers.py", line 142, in _run_interface
	    out = function_handle(**args)
	  File "<string>", line 25, in get_bolus_duration
	TypeError: 'float' object is not subscriptable
aslprep-latest.simg \
  "${aslprep_in}/" \
  "${aslprep_out}/" \
  participant \
  --participant_label "${participant}" \
  --fs-license-file "$HOME/Documents/license.txt" \
  --level full \
  --scorescrub \
  --basil \
  --skull-strip-t1w force \
  --fs-subjects-dir "${fs_dir}/" \
  --fs-no-reconall \
  --notrack \
  -w "${work_dir}" \
  --nthreads "4" \
  --mem-mb "16000" \
@Samuel-Maddox Samuel-Maddox added the bug Something isn't working label Apr 11, 2024
@tsalo
Copy link
Member

tsalo commented Apr 11, 2024

Is your ASL data from a Q2TIPS PASL sequence?

@Samuel-Maddox
Copy link
Author

Is your ASL data from a Q2TIPS PASL sequence?

Yes I believe so.

@tsalo
Copy link
Member

tsalo commented Apr 15, 2024

In that case, BolusCutOffDelayTime needs to be a list with two elements- the durations of the first and last pulses (see here).

@Samuel-Maddox
Copy link
Author

In that case, BolusCutOffDelayTime needs to be a list with two elements- the durations of the first and last pulses (see here).

Thanks for the help, I'll have another look at the data and give this a try!

@tsalo
Copy link
Member

tsalo commented Nov 1, 2024

@Samuel-Maddox any update on this? If the corrected BolusCutOffDelayTime works then I'll close this issue.

@Samuel-Maddox
Copy link
Author

Hello, this was a while ago but I believe it did resolve my issue. Thanks for the help, and feel free to close this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants