Coder Social home page Coder Social logo

Apply TractSeg to the study specific population template using the peaks of the spherical harmonic function at each voxel as input about tractseg HOT 9 OPEN

Nassim3235 avatar Nassim3235 commented on August 19, 2024
Apply TractSeg to the study specific population template using the peaks of the spherical harmonic function at each voxel as input

from tractseg.

Comments (9)

wasserth avatar wasserth commented on August 19, 2024

The code is having problems downloading the model weights from zenodo. Sometimes zenodo is having download issues. I would suggest to try it again another time and/or from another internet network.

from tractseg.

Nassim3235 avatar Nassim3235 commented on August 19, 2024

Thanks a lot! I fixed the problem. The following commands runned correctly:
TractSeg -i peaks.nii.gz -o template/tract_segmentation/ --output_type tract_segmentation
TractSeg -i peaks.nii.gz -o template/endings_segmentation/ --output_type endings_segmentation

But, when I try to run "TractSeg -i peaks.nii.gz -o template/TOM/ --output_type TOM" , There is no file in TOM folder and I get the following error:

Error:

Loading weights from: /home/gha/.tractseg/pretrained_weights_peak_regression_part1_v2.npz
100%|█████████████████████████████████████████| 144/144 [00:22<00:00, 6.44it/s]
joblib.externals.loky.process_executor._RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/gha/miniconda3/lib/python3.9/site-packages/nibabel/loadsave.py", line 42, in load
stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'template/TOM/bundle_segmentations/AF_left.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/gha/miniconda3/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py", line 428, in _process_worker
r = call_item()
File "/home/gha/miniconda3/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py", line 275, in call
return self.fn(*self.args, **self.kwargs)
.
.
.
.
FileNotFoundError: No such file or no access: 'template/TOM/bundle_segmentations/AF_left.nii.gz'

from tractseg.

wasserth avatar wasserth commented on August 19, 2024

Is this the complete error message? There seems to be missing something.

from tractseg.

Nassim3235 avatar Nassim3235 commented on August 19, 2024

This is the complete error message:

TractSeg -i peaks.nii.gz -o template/TOM/ --output_type TOM

Loading weights from: /home/gha/.tractseg/pretrained_weights_peak_regression_part1_v2.npz
Downloading pretrained weights (~140MB) ...
downloaded in 913.93s
100%|████████████████████████████████████████| 144/144 [00:23<00:00, 6.24it/s]
joblib.externals.loky.process_executor._RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/gha/miniconda3/lib/python3.9/site-packages/nibabel/loadsave.py", line 42, in load
stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'template/TOM/bundle_segmentations/AF_left.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/gha/miniconda3/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py", line 428, in _process_worker
r = call_item()
File "/home/gha/miniconda3/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py", line 275, in call
return self.fn(*self.args, **self.kwargs)
File "/home/gha/miniconda3/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 620, in call
return self.func(*args, **kwargs)
File "/home/gha/miniconda3/lib/python3.9/site-packages/joblib/parallel.py", line 288, in call
return [func(*args, **kwargs)
File "/home/gha/miniconda3/lib/python3.9/site-packages/joblib/parallel.py", line 288, in
return [func(*args, **kwargs)
File "/home/gha/miniconda3/lib/python3.9/site-packages/tractseg/libs/peak_utils.py", line 263, in _process_bundle
img = nib.load(join(tract_seg_path, bundle + ".nii.gz"))
File "/home/gha/miniconda3/lib/python3.9/site-packages/nibabel/loadsave.py", line 44, in load
raise FileNotFoundError(f"No such file or no access: '{filename}'")
FileNotFoundError: No such file or no access: 'template/TOM/bundle_segmentations/AF_left.nii.gz'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/gha/miniconda3/bin/TractSeg", line 420, in
main()
File "/home/gha/miniconda3/bin/TractSeg", line 325, in main
seg = run_tractseg(data, args.output_type,
File "/home/gha/miniconda3/lib/python3.9/site-packages/tractseg/python_api.py", line 240, in run_tractseg
seg = peak_utils.mask_and_normalize_peaks(seg, tract_segmentations_path,
File "/home/gha/miniconda3/lib/python3.9/site-packages/tractseg/libs/peak_utils.py", line 271, in mask_and_normalize_peaks
results_peaks = Parallel(n_jobs=nr_cpus)(delayed(_process_bundle)(idx, bundle)
File "/home/gha/miniconda3/lib/python3.9/site-packages/joblib/parallel.py", line 1098, in call
self.retrieve()
File "/home/gha/miniconda3/lib/python3.9/site-packages/joblib/parallel.py", line 975, in retrieve
self._output.extend(job.get(timeout=self.timeout))
File "/home/gha/miniconda3/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 567, in wrap_future_result
return future.result(timeout=timeout)
File "/home/gha/miniconda3/lib/python3.9/concurrent/futures/_base.py", line 445, in result
return self.__get_result()
File "/home/gha/miniconda3/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
raise self._exception
FileNotFoundError: No such file or no access: 'template/TOM/bundle_segmentations/AF_left.nii.gz'

from tractseg.

wasserth avatar wasserth commented on August 19, 2024

For the previous commands (output type tract_segmentation and endings_segmentations) you have to specify the same output folder. And for output_type TOM as well. The correct subfolders are automatically generated. Just do it the same way as it is stated in the documentation.

from tractseg.

Nassim3235 avatar Nassim3235 commented on August 19, 2024

Problem solved. Thank you very much for your help.

from tractseg.

yutinghe99 avatar yutinghe99 commented on August 19, 2024

Hi,
I met the same problem as yours, could you please tell me how did you solve the Failed to establish a new connection: [Errno 111] Connection refused'))? Just changed the internet network?

from tractseg.

Nassim3235 avatar Nassim3235 commented on August 19, 2024

Hi,
Yes, we just changed the internet network.

from tractseg.

yutinghe99 avatar yutinghe99 commented on August 19, 2024

Thanks! I solved the problem. I also try to apply TractSeg to the study specific population template. I've done whole brain fixel-based analysis according to the MRtrix3 document. And I got some significant FC, FD, FDC fixels between 3 of my groups. Now I would like to label those tracts which have significant fixels. I followed this scripts https://osf.io/9ch6a, ran the following commands
sh2peaks wmfod_template_MNI.mif peaks.nii.gz TractSeg -i peaks.nii.gz -o tractseg/ --output_type tract_segmentation TractSeg -i peaks.nii.gz -o tractseg/ --output_type endings_segmentation TractSeg -i peaks.nii.gz -o tractseg/ --output_type TOM Tracking -i peaks.nii.gz -o tractseg/ --tracking_format tck --nr_fibers 10000

The given scripts is an Tract-of-interest analysis, I"d to do whole brain analysis, and I want to know what's the next step according to my goal?

Seems you are also doing the FBA, I would appreciate it if you could give me some guidance.

Yuting

from tractseg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.