Comments (13)
Got it Leonie, that's very helpful. Let me try and I'll close if I don't have any other issue. Nice work!
from fastsurfer.
Currently FastSurfer does not support re-running parts of the pipeline, but it is on the to-do list.
from fastsurfer.
Some other messages:
eval.py:376: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
aseg_lh = gaussian_filter(1000 * np.asarray(pred_prob == 2, dtype=np.float), sigma=3)
eval.py:377: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
aseg_rh = gaussian_filter(1000 * np.asarray(pred_prob == 41, dtype=np.float), sigma=3)
from fastsurfer.
Hey,
if you add the --fsaparc flag to the run command, the other default FreeSurfer atlases should be segmented as well. These are skipped by default (--> DKTatlas from the DL prediction is used which is faster).
./run_fastsurfer.sh --t1 /your/input/image.nii.gz --sd /your/output/dir --sid YourSubjectID --fsaparc
Best,
Leonie
from fastsurfer.
Thank you @LeHenschel . Just curious if DKTatlas would be the only version for output with adding -fsaparc as considering other default FS atlases? So for example, would a2009s labels be included also for the updated output with the -fsaparc option?
Btw, does fast surfer output the full folder structures for segmentation only, e.g. label or stats, as generated by Freesurfer?
Thanks again! Shengwei
from fastsurfer.
Hi, with -fsaparc you should get all the FS atlas versions. Also FastSurfer does output full folder structure. It is missing only a few intermediate files which are not required for our processing steps.
from fastsurfer.
Thank you professor @m-reuter for the update. Would you mind providing more detailed usage as such? Below was the command tried:
cd $fastsurfer
./run_fastsurfer.sh --t1 $t1.nii.gz --sid $id --sd $dest --py python --seg_only --parallel --fsaparc
I only got $dest/{mri,scripts} and only aparc.DKTatlas+aseg.deep.mgz & deep-seg.log. Ideally a full FS folder structure with $dest/{label, stats, ...} folders would be expected, and aparc.a2009s+aseg.deep.mgz would be expected in folder $dest/mri. Are they achievable and how? Thanks again!
from fastsurfer.
Hey Shengwei,
the fsaparc flag only takes effect if you run the entire fastsurfer pipeline (including recon-surf). The --seg_only flag only runs the DL prediction which is limited to the DKTatlas.
So regarding your inital question
Btw, does fast surfer output the full folder structures for segmentation only, e.g. label or stats, as generated by Freesurfer?
-
No, with the --seg_only you only get the segmentation (so what you observed: mri/aparc.DKTatlas+aseg.deep.mgz and scripts/deep-seg.log)
-
You can potentially extract the volume stats already from the segmentation (only for the DKTatlas). However, in FreeSurfer the workflow here also considers some partial volume corrections via the norm.mgz etc. Hence, so far we only include the option to get the stats volume outputs after the norm.mgz has been generated. You can run this part only (without the surfaces) by adding the --vol_segstats flag:
- From the help:
--vol_segstats Additionally return volume-based aparc.DKTatlas+aseg statistics for DL-based segmentation (does not require surfaces). Can be used in combination with --seg_only in which case recon-surf only runs till CC is added (akin to --seg_with_cc_only)."
- Your command would look like this:
- From the help:
cd $fastsurfer
./run_fastsurfer.sh --t1 $t1.nii.gz --sid $id --sd $dest --py python --seg_only --vol_segstats --parallel --fsaparc
-
For the $id/labels folder and the other atlas segmentations you need to run the entire pipeline, because these are based on the surfaces (which will be generated in the recon-surf part). The a2009s segmentation also requires you to run the entire pipeline.
So in this case, your command would look like this:
cd $fastsurfer
./run_fastsurfer.sh --t1 $t1.nii.gz --sid $id --sd $dest --py python --parallel --fsaparc
Hope this helps.
Best,
Leonie
from fastsurfer.
One more question as I'm running it on a Azure VM (6 cpus w/ 56G RAM): does the --thread option only affect the surface pipeline? Setting up the OMP/ITK threads could accelerate the processing time if I understand correctly. But how should I choose? My final goal is to dockerize it for a pre-selected VM size, so I can scale it to a larger population.
from fastsurfer.
Note that the full pipeline is of course much longer than the 1 minute (GPU) for segmentation. If you run purely CPU also the segmentation will be much slower (like around 30 mins or longer).
About the --thread option, it only affects the recon_surf pipeline, so basically all FreeSurfer executables that can do parallel processing. Not sure which these are but with 6 CPUs you should definitely try to run in parallel, maybe try 6 and you can run both hemispheres in parallel (--parallel flag).
from fastsurfer.
I see, will try using as many threads as the number of cpus. And I'm trying it on a GPU VM so it does run FAST! Another question, hopefully the last, that comes to mind is that should I re-run if there's any manual correction(s) made? FS has some flags for re-running recon-all after correction on WM/pial/talairach transformation etc. Would re-running fastsurfer consider any updates to the corrected file(s)? Thanks for the update!
from fastsurfer.
Just finished my trial for the full pipeline with just one thread. And the outputs resemble the FS ones so I guess it runs well.
One thing I noticed was that the aparc.a2009s+aseg.mgz was still missing (this was what we've been using throughout the analyses) but the corresponding label/annot & stats existed. Would it be possible to generate the actual segmentation image from the existing outputs? Thanks!
from fastsurfer.
Great. The easiest would be to run recon_all from FreeSurfer with the -aparc2aseg flag. It will create those files. See here for the command it uses: https://github.com/freesurfer/freesurfer/blob/b28bb9591cb2de638f3bc560d41cf4f4e13b815a/scripts/recon-all#L4601
So if you want only one of those files, run this one time, look at the log file and copy the exact command for the left and right hemisphere. Not sure why we don't create those. Maybe it is (or was) not part of the stream in FS 6.0 .
from fastsurfer.
Related Issues (20)
- CC values all 0 in aseg+DKT.stats HOT 5
- input image contains negative values and gpu memory issue HOT 6
- Issue creating symbolic links when running fastsurfer-gpu.sif HOT 6
- Error during smooth_aparc.py mode HOT 1
- Error during smooth_aparc.py mode_filter HOT 5
- Biasfield-corrected image input of the segstats.py HOT 4
- Use of '--rm' argument in build.py results in a TypeError HOT 4
- Is it possible to get segstats of cerebellum after run FastSurfer pipeline? HOT 3
- Some zeros in aseg.stats HOT 8
- Fooocus colab stopping with this error HOT 4
- FastSurfer surf pipeline did not finish: Missing .label files (not enough memory for mris_sample_parc) HOT 11
- conform.py bug HOT 2
- srun_fastsurfer.sh on HPC, surface pipeline fails for hundreds but works for tens of subjects HOT 8
- Question about content of wmparc.DKTatlas.mapped.mgz HOT 1
- Support for lesion masks? HOT 1
- Unmatched ROIs in predicted segmentation and provided FastSurfer_ColorLUT.tsv HOT 23
- FastSurfer Segmentation Modules: disable conformation of input image to isometric spaces HOT 5
- FastSurfer QuickSeg doesn't work with OASIS `.img` files HOT 3
- Docker build workflows HOT 5
- Model download issue HOT 22
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastsurfer.