pycortex icon indicating copy to clipboard operation
pycortex copied to clipboard

cutting surface using Blender

Open sunjc73 opened this issue 6 years ago • 4 comments

I am using glrework-merged branch. When I used Blender to cut the cortex, I got the wrong flatten results by using cortex.segment.cut_surface(). The result of the segmentation is shown in the following figure. 2018-02-05 17-28-06

The flatten result is shown in the following figure. As you can see, the flatten cortex becomes a combination of many fragments. 2018-02-05 17-44-55

In addition, when blender is in the edit mode, the cerebral cortex is shown as below 2018-02-05 17-29-48 When some of the faces were deleted, the cerebral cortex was shown as shown below. So I don't know what is the reason for this change. 2018-02-05 17-32-05

I'm not familiar with the use of Blender, so can you provide a tutorial on how to use blender for the cut of the cortex

sunjc73 avatar Feb 05 '18 11:02 sunjc73

Hi there, You've deleted vertices instead of marking the seams. This will upset the vertex order, and will cause face scrambling as you observed. Using blender for flattening goes along two steps:

  1. Select the medial wall using the standard selection tools, the delete ONLY FACES AND EDGES.
  2. Select the cuts by ctrl-clicking along the cut line (to select shortest paths), the marking the line as a seam in blender.

Once you've saved the file, pycortex will understand how to process the surface for flattening. You will likely need to start over with a new blender file, so go inside your filestore and delete the .blend files for this subject to start over.

jamesgao avatar Feb 05 '18 17:02 jamesgao

Wow, it works, thank you very much for your quick response.

Jiancheng Sun

sunjc73 avatar Feb 06 '18 03:02 sunjc73

Hi Gao, There's a new problem when the cortex.segment.cut_surface() finished. I use the API as: cortex.segment.cut_surface("subject_test","lh")

The results were shown as:

... optimization complete. unfolding took 2.08 hours MRISunfold() return, current seed -1517898844 writing flattened patch to /home/sunjc/program/freesurfer_DIR/subject_test/surf/lh.flatten.flat.patch.3d created by sunjc on Mon Jan 29 13:24:59 2018

saving to /home/sunjc/program/anaconda2/share/pycortex/db/subject_test/surfaces/flat_lh.gii created by sunjc on Mon Jan 29 13:25:03 2018 saving to /home/sunjc/program/anaconda2/share/pycortex/db/subject_test/surfaces/flat_rh.gii

As you can see, two flatten files were created, i.e. flat_lh.gii and flat_rh.gii. what's meaning with two files? I think this command can only produce flat_lh.gii.

At this point, I run the example plot_dataset_arithmetic.py (rh hemisphere has not been flattened.), and the result was shown as:

figure_2

In addition, I observed that there are two blend files (The suffix names are .blend and .blend1, respectively) under the directory ./anaconda2/share/pycortex/db/subject_test/anatomicals, cutsurf[hemi=rh,name=flatten].blend and cutsurf[hemi=rh,name=flatten].blend1, respectively. Is this normal?

Jiancheng Sun

sunjc73 avatar Feb 06 '18 09:02 sunjc73

  1. Select the medial wall using the standard selection tools, the delete ONLY FACES AND EDGES.
  2. Select the cuts by ctrl-clicking along the cut line (to select shortest paths), the marking the line as a seam in blender.

Wow, it works, thank you very much for your quick response.

Jiancheng Sun

Hello, Sun. can I ask you the details about Blender just for a while. Would you please share your e-mail address? Or any available access?

luoying050601 avatar Oct 20 '20 08:10 luoying050601