index 3 is out of bounds for dimension 1 with size 2 deformetrica

61 views
Skip to first unread message

Zicheng Zhu

unread,
Jul 30, 2021, 3:13:15 PM7/30/21
to Deformetrica
Hello, 

I tried to run the examples/atlas/landmark/3d/brain_structures

command: "deformetrica estimate model.xml data_set.xml -p optimization_parameters.xml"

problem: 

self.centers, self.normals = SurfaceMesh._get_centers_and_normals(

  File "/Users/Ricky/opt/anaconda3/lib/python3.8/site-packages/deformetrica/core/observations/deformable_objects/landmarks/surface_mesh.py", line 61, in _get_centers_and_normals

    c = points[triangles[:, 3]]

IndexError: index 3 is out of bounds for dimension 1 with size 3.


When I run 2d example, it was fine. 



Zicheng Zhu

unread,
Jul 30, 2021, 3:29:54 PM7/30/21
to Deformetrica
hello again,

The same problem happened again when I ran my 2d models. I wanted to combine two 2d vtk files together. 

data_set.xml:
<?xml version="1.0"?>
<data-set>
    <subject id="00-1-AP-15L0214">
        <visit id="experiment">
            <filename object_id="NR-00-1-AP">Data/mc115L0214.vtk</filename>
            <filename object_id="NR-00-1-AP">Data/tpm15L0214.vtk</filename>
        </visit>
    </subject>
    <subject id="00-1-AP-15L0222">
        <visit id="experiment">
            <filename object_id="NR-00-1-AP">Data/mc115L0222.vtk</filename>
            <filename object_id="NR-00-1-AP">Data/tpm15L0222.vtk</filename>
        </visit>
    </subject>
</data-set>

model.xml:
<?xml version="1.0"?>
<model>
    <model-type>DeterministicAtlas</model-type>
    <dimension>2</dimension>

    <template>

        <object id="NR-00-1-AP">
            <deformable-object-type>SurfaceMesh</deformable-object-type>
            <attachment-type>Varifold</attachment-type>
            <noise-std>1</noise-std>
            <kernel-width>3</kernel-width>
            <kernel-type>keops</kernel-type>
            <filename>Data/FM_template-AP.vtk</filename>
        </object>

        <object id="NR-00-1-AP">
            <deformable-object-type>SurfaceMesh</deformable-object-type>
            <attachment-type>Varifold</attachment-type>
            <noise-std>1</noise-std>
            <kernel-width>3</kernel-width>
            <kernel-type>keops</kernel-type>
            <filename>Data/TPM_template-AP.vtk</filename>
        </object>

    </template>

    <deformation-parameters>
        <kernel-width>4</kernel-width>
        <kernel-type>keops</kernel-type>
        <number-of-timepoints>10</number-of-timepoints>
    </deformation-parameters>

</model>

optimization_parameters:
<?xml version="1.0"?>
<optimization-parameters>
    <optimization-method-type>GradientAscent</optimization-method-type>
<!--    <max-iterations>300</max-iterations>-->
<!--    <convergence-tolerance>1e-5</convergence-tolerance>-->
<!--    <use-sobolev-gradient>On</use-sobolev-gradient>-->
<!--    <freeze-template>On</freeze-template>-->
</optimization-parameters>
Reply all
Reply to author
Forward
0 new messages