Forum Replies Created
-
AuthorPosts
-
David ShattuckKeymaster
hi Huizhang –
All of the command-line programs in the BrainSuite bin dir that write surface files should save them as .stl files if you use the .stl extension for the output file. The caveat to this is that stl files don’t carry enough information for the BrainSuite pipelines to use them as inputs, so effectively you would need to run a step twice to get a .dfs version and a .stl version. We don’t have a file converter program included with the software, but I will probably add one for the next release.
You could try this with dfs if you have a mask file. Below is an example on my Mac. You can see it generates a .stl file.
shattuck:~>/Applications/BrainSuite21a/bin/dfs -i /Applications/BrainSuite21a/svreg/BCI-DNI_brain_atlas/BCI-DNI_brain.cortex.dewisp.mask.nii.gz -o brain.stl
wrote surface file brain.stl
shattuck:~>head brain.stl
solid brain.stl
facet normal 0 0 0
outer loop
vertex 46.5981 106.954 80.565
vertex 46.1262 106.945 80.6693
vertex 46.4666 106.725 80.639
endloop
endfacet
facet normal 0 0 0
outer loop
thanks,
DavidDavid ShattuckKeymasterHello — that is the only download link we have.
thanks,
DavidDavid ShattuckKeymasterHi Adrien –
It took a little longer than expected because we have been preparing a major release of BrainSuite (v23a, out now), as well as an updated BrainSuite BIDS App. We were making some improvements to the underlying methods, including some optimizations in how the streamline filtering is performed.
The new package includes a program call filterdft, which is in the bin directory. You can use it to perform all of the filtering options that are available in the GUI. These are performed (in order, but the order shouldn’t matter):
* remove streamlines shorter than the length threshold if specified (-l setting)
* remove streamlines that intersect labels in the exclude list (specified as –exclude # # #)
* remove streamlines based on spherical ROI filters if specified (uses an xml file)
* remove streamlines unless they intersect labels in the include list (specified as –include # # #)By default, it will use an or operation for the final check, so if you wanted to include all streamlines that intersect the superior frontal gyri, you would run:
filterdft -i input.dft -o output.dft --include 120 121
You can use the –and flag if you want to have the streamlines go through *all* labels specified, e.g,. if you want to find streamlines that connect the brainstem (800) and cerebellum (900), you would use:
filterdft -i input.dft -o output.dft --include 800 900 --and
The full set of options is listed below.
Let me know if that provides the functionality that you need.
thanks,
Davidusage: filterdft [settings] required settings: -i
input file -o output file -l filename label volume (must be 16-bit) optional settings: --license show the license information -g debug -v verbosity [default: 0] --length length length threshold [default: 0] --include labelID1 ... labelIDN (include these labels) --exclude labelID1 ... labelIDN (exclude these labels) --and tracks must pass through all labels in include list --dont-merge don't merge cortical gm/wm labels -s filename sphere ROI xml file - This reply was modified 9 months ago by David Shattuck.
David ShattuckKeymasterhi Adrien –
I’m working on it — still need to do some testing. Will follow up by email soon with a few questions.
thanks,
DavidDavid ShattuckKeymasterI am not near a Windows machine at the moment, but I just tried this on Linux using the data from https://brainsuite.org/tutorials/dtiexercise/ and it started. I copied the arguments from your post.
I will try it on Windows later today and get back to you.
BrainSuiteTutorialDWI>/opt/BrainSuite21a/bdp/bdp.sh 2523412.bfc.nii.gz --tensor --nii 2523412.dwi.nii.gz -g 2523412.dwi.bvec -b 2523412.dwi.bval BDP Version: 21a (build #0081), released 2021-05-05 ================================================================================ Setting up dataset and inputs ================================================================================ Reading input flags... Checking input files... .mask.nii.gz file found: 2523412.mask.nii.gz BDP will use this file as brain mask. You can specify a custom brain mask by using flag --t1-mask
. The custom mask must overlay correctly with input BFC image in BrainSuite. Processing data with fileprefix: 2523412 ================================================================================ Co-registration and Distortion Correction ================================================================================ Reading the input parameters for co-registration... Total memory (physical+swap) found: 126.53GB David ShattuckKeymasterIf you enclose your text with pre tags, it should show it as you wrote it. [code] doesn’t work, unfortunately. pre uses angle brackets rather than square brackets.
- This reply was modified 11 months, 1 week ago by David Shattuck.
David ShattuckKeymasterIf you install Matlab or the Matlab runtime library to the default location, the scripts should find it. If you installed it somewhere else, you can set an environment variable ‘BrainSuiteMCR’ on Linux or Mac before running the script. For Linux, the default for the Matlab runtime would be:
export BrainSuiteMCR="/usr/local/MATLAB/MATLAB_Runtime/v97"
or for the full Matlab install:
export BrainSuiteMCR="/usr/local/MATLAB/R2019b/runtime"
Note that this is different for Mac.
You can also edit the scripts in the BrainSuite svreg and bdp folders, but setting an environment variable will be easier.
You shouldn’t need to do this for Windows, because Windows stores the location in its registry.
-David
David ShattuckKeymasterhello –
Our forum software changes how hyphens appear, so it can be difficult to tell exactly what you wrote. I think you have two hyphens before g and b, but these should only have one. Try running this:
"C:\Program Files\BrainSuite21a\bdp\bdp.exe" 2523412.bfc.nii.gz --tensor –-nii 2523412.dwi.nii.gz -g 2523412.dwi.bvec -b 2523412.dwi.bval
and see if that fixes the problem.
thanks,
DavidDavid ShattuckKeymasterIf you send an email to support at brainsuite.org, I’ll see what I can do. Let me know what platform (Mac/Win/Linux) you are using.
thanks,
DavidDavid ShattuckKeymasterHello –
I have written some command-line tools that can probably do this. I thought we were distributing them, but I just checked and they aren’t in the public release yet.
Can you be more specific about what you are trying to do and what steps you are taking? Are you trying to give it pairs of ROIs and save out a .dft file?
thanks,
DavidDavid ShattuckKeymasterYou will need to install Matlab Runtime 2019b if you don’t have Matlab 2019b installed. The programs for BDP and SVReg are built using the Matlab Compiler for version 2019b, so they require that specific version of the runtime libraries.
There won’t be a conflict with your existing installation. The files are located in a separate directory and the different versions of Matlab products will load the appropriate libraries.
-David
David ShattuckKeymasterHi — it’s actually very easy. When you have a surface file loaded in BrainSuite, you can just save it and use a .stl extension. From the Surface Display toolbox, you would select the surface you want to save, click on the save icon, and type a filename ending in .stl.
However, I just tried this on my Mac running Monterey (12.6) and it now won’t let me do that. I think this is a recent change with the OS, so I’ll fix that in the next release. It should still work on Linux or Windows.
Give that a try and let me know how it goes. What surface are you trying to print?
thanks,
David ShattuckDavid ShattuckKeymasterIf you want to show exact commands, I think you can use html code blocks. Unfortunately, WordPress converts double dashes into a single em dash character (em dashes are the width of an m character, en dashes are the width of an n character).
For example, if you type
<code>--flag</code>
Wordpress will display
--flag
You can also use back ticks in place of the code tags.
If you want to show a command line, please put try the code tags.
- This reply was modified 2 years, 2 months ago by David Shattuck.
- This reply was modified 2 years, 2 months ago by David Shattuck.
- This reply was modified 2 years, 2 months ago by David Shattuck.
David ShattuckKeymasterCan you provide more details on how you are running it?
Have you installed the Matlab Runtime 2019b?
We developed and tested the latest release extensively on Windows 10, so it should run provided you have the Matlab Runtime installed. It has to be 2019b specifically. Mathworks link here: https://ssd.mathworks.com/supportfiles/downloads/R2019b/Release/3/deployment_files/installer/complete/win64/MATLAB_Runtime_R2019b_Update_3_win64.zip
thanks,
David ShattuckDavid ShattuckKeymasterhi –
For use with BrainSuite, you can usually skip adding the environment variables to your path. We have done this in the shell scripts that we use to call the compiled MATLAB programs. If you look, for example, at the bdp.sh script, you can see this bit:
# Set up path for MCR applications. LD_LIBRARY_PATH=.:${BrainSuiteMCR}/runtime/glnxa64 ; LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${BrainSuiteMCR}/bin/glnxa64 ; LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${BrainSuiteMCR}/sys/os/glnxa64; MCRJRE=${BrainSuiteMCR}/sys/java/jre/glnxa64/jre/lib/amd64 ; LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ; LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ; LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ; XAPPLRESDIR=${BrainSuiteMCR}/X11/app-defaults ; export LD_LIBRARY_PATH; export XAPPLRESDIR; BDPEXEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" ; export BDPEXEDIR; "${exe_dir}/bdp" "$@"
which sets the library paths before calling bdp. BrainSuiteMCR gets set at the start of the script based on standard installation locations, or you can set it as an environment variable (useful for you install it in a non-default location). This strategy should reduce the impact of the installation.
You can undo the changes you made to your .bashrc file and give it a try.
thanks,
David -
AuthorPosts