- This topic has 8 replies, 5 voices, and was last updated 10 months, 3 weeks ago by Anand Joshi.
-
AuthorPosts
-
-
September 28, 2021 at 9:06 am #2958grojasParticipant
Hi:
I need to convert the cortical surface from DFS format to another mesh format (STL, OBJ for example)… How can I do it?
Sincerely,
Gonzalo Rojas Costa
-
September 28, 2021 at 9:34 am #2959Anand JoshiModerator
You can just save the surface with .obj extension. It will be saved in obj format.
Another alternative is to import it in matlab or python and then save it back.
The readers for matlab and python for the dfs format are included in the source code. The file names for them are readdfs.m and dfsio.py. -
September 28, 2021 at 9:51 am #2961grojasParticipant
I saved it to obj format using BrainSuite, but I tried to open it using 3DSlicer, but it fails… Why?
Sincerely,
Gonzalo Rojas Costa
-
October 1, 2021 at 1:39 am #2962David ShattuckKeymaster
hi Gonzalo –
The obj format used in BrainSuite is the MNI obj format, which was more widely used when we first developed BrainSuite.
There is a way to get a Wavefront obj file from BrainSuite — if you save out a surface file using .wfo as the extension (I used wfo to represent WaveFront Obj) and then change the extension to .obj, you should be able to use it in programs that read Wavefront Obj files. I do this sometimes when I want to look at BrainSuite surfaces in Meshlab, and it works fine.
You can also use a .stl extension, and the surface will be saved in STL format. Some of our users have used this to 3D print brain models made in BrainSuite.
Just one note — both of these formats lose some of the information that BrainSuite uses in its different functions.
Give it a try and let us know if it works for you.
thanks,
David Shattuck -
October 23, 2023 at 9:21 pm #4851huizhang1032Participant
Hello, I would like to ask if it is possible to save a surface file in .stl format based on the command line?
-
October 24, 2023 at 2:29 am #4852Anand JoshiParticipant
You can do it from the gui but not command line that I am aware of.
-
October 24, 2023 at 2:56 am #4856David 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,
David-
October 25, 2023 at 12:47 pm #4858huizhang1032Participant
Okay, thanks so much. I’m going to try it.
I want to get slices.bse.inner.cortex.dfs, slices.bse.inner_skull.dfs, slices.bse.left.inner.cortex.dfs, slices.bse.left.pial.cortex.dfs, slices.bse.outer_skull.dfs, slices.bse.pial.cortex.dfs, slices.bse.right.inner.cortex.dfs, slices.bse.right.pial.cortex.dfs, slices. bse.scalp.dfs and other files in .stl format, then what are the corresponding BCI-DNI_brain.cortex.dewisp.mask.nii.gz? Can I realize all the above file format conversion?
-
-
October 25, 2023 at 3:12 pm #4859Anand JoshiParticipant
.cortex.dewisp.mask.nii.gz will generate .inner.cortex.dfs
-
-
AuthorPosts
- You must be logged in to reply to this topic.