SCIRun User Mailing List

Text archives Help


[SCIRUN-USERS] Error with BioMesh3D


Chronological Thread 
  • From: Trevor Aguirre <aguirretrevor@gmail.com>
  • To: scirun-users@sci.utah.edu
  • Subject: [SCIRUN-USERS] Error with BioMesh3D
  • Date: Sat, 23 Dec 2017 13:42:34 -0700

Hello,

I have a question about using BioMesh3D

I am trying to run through the tutorial for the tooth. I have modified the model_config.py file to reflect the correct directory for the tooth-seg-unorient.nrrd file as well as modified the model_config.py for the correct output directory. The tooth-seg-unorient.nrrd and the model_config.py are in the same folder on my desktop. When trying to run this from cmd.exe I encounter the errors below and in the attached image. 

The first steps are me changing my working directory to reflect the directory where the BuildMesh.py file is on my computer and then me entering the file path to where tooth-seg-unorient.nrrd and the model_config.py files are located on my PC. 

It says invalid syntax was encountered in the BuildMesh.py file at line 262. Do you have any insight on this issue? I am not sure what I have done incorrectly so any insight would be much appreciated. I have attached my model_config.py file if it is need. 

Begin error message

U:\>C:
C:\>cd Program Files\SCIRun 4.7\bin\FEMesher
C:\Program Files\SCIRun 4.7\bin\FEMesher>BuildMesh.py
default binary_dir = C:\Program Files\SCIRun 4.7\bin
Model configuration file is needed to run meshing pipeline.
Which model configuration file to use?  C:\Users\aguirret\Desktop\Tooth\model_config.py
Traceback (most recent call last):
  File "C:\Program Files\SCIRun 4.7\bin\FEMesher\BuildMesh.py", line 262, in <module>
    exec(open(model_config).read())
  File "<string>", line 77
    ags available in this option are the same as the previous variable. It
                ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\SCIRun 4.7\bin\FEMesher\BuildMesh.py", line 265, in <module>
    Utils.write_error(err_message)
  File "C:\Program Files\SCIRun 4.7\bin\FEMesher\Utils.py", line 87, in write_error
    txt_file = open(stage_path, 'w')
PermissionError: [Errno 13] Permission denied: '.\\mesh_state.txt'

End error message



Best regards and looking forward to your reply,


Trevor G. Aguirre
PhD Student, Mechanical Engineering, Colorado State University
Graduate Research Assistant, Orthopaedic Bioengineering Research Laboratory
National Graduate Representative, Society of Hispanic Professional Engineers

# The model config:py setup file needs to be edited to fit your machine and
project.
# It is suggested that a model config.py file be made for each dataset run in
BioMesh3D.
# There are several variables in the model config:py that need to be set.
# 1) model_input_file, 2) model_output_path, 3) mats, 4) mat_names, 5)
mat_radii,
# 6) refinement_levels, 7) max_sizing_field, 8) SIZING_SCALE_VAR, 9)
num_particle_iters
# 10) tetgen)_joined_vol_flags, and 11) max_procs.

# The path for the mesh that will be input into the pipeline; in
# our case, the segmentation of the tooth (.../tooth.nrrd).

model_input_file="~/C:/ProgramFiles/SCIRun4.7/bin/FEMesher/Tooth/tooth-seg-unorient.nrrd"

# Original model_input_file definition from example.
#
model_input_file="~/software/trunk/SCIRunData/FEMesher/tooth/tooth-seg-unorient.nrrd"

# The path for the output files that will be generated by BioMesh3D
(.../tooth).

model_output_path="~/Tooth"



# The mask or data values of the materials in the input fields. In the case
# of our tooth segmentation, there are four materials: the three di erent
regions
# that we segmented, and the air around it. These are all assigned a value by
# Seg3D, beginning with 0. With the tooth file that we are using, we will
assign
# this variable (0,1,2,3).

mats = (0, 1, 2, 3)


# The names of the materials labeled in the segmentation. Each
# material labeled in the mats variable needs to have unique name. For
simplicity,
# we will assign the mat names variable (`air', `mat1', `mat2', `mat3').

mat_names = ('air', 'mat1', 'mat2', 'mat3')


# This variable is a parameter for the tightening that is performed in
# the second stage to make the meshes smoother. To turn on tightening, such as
# for very thin (one or two voxels thick) meshes, set this parameter to 0.
For the
# tooth file that we are using, we can leave the default value 0.8.

mat_radii = 0.8



# This will modify the generation and refinement of the medial
# axis points. A higher value will allow for more refinement, and thus medial
axis
# points will be closer together. This variable can be set higher if the
segmentation
# is very small or narrow.

refinement_levels=4



# Modifies the sizing field algorithm. A lower number generates
# more final elements on the tetrahedral mesh.

MAX_SIZING_FIELD = 5.0

# A lower number generates more final elements on the
# tetrahedral mesh.

SIZING_SCALE_VAR = 2.0


# The number of iterations used in the particle system in
# stage 6 of the pipeline. The particle system generates equally spaced
points to
# generate tetrahedra. For the tooth.nrrd le, set the variable to 500.

num_particle_iters = 500


# This variable is similar to the previous, except it applies
# to the tetrahedral models generated for all the materials combined into a
single
# file. The
ags available in this option are the same as the previous variable. It
# can be left as \zpAAqa10".
tetgen_joined_vol_flags = "zpAAqa10"


# Caps the number of processes used by the particle system (stage 6).
max_procs=2



# This variable came with the orginal model_config.py file for the tooth.
# It wasn't defined in "Meshing Pipeline User Guide"
CONSTAN_SIZING_FIELD = 5

Attachment: BioMesh3d_cmddotexe_error.PNG
Description: PNG image




Archive powered by MHonArc 2.6.18.

Top of page