I have a little issue concerning the representation of a string in Python.
I have the following Python code:
#!/usr/bin/env python
import sys
import math
import string
from vmtk import pypes
from vmtk import vmtkscripts
seedPointCoordinates = "399 268 364"
targetPointCoordinates = [" 367 264 361 " , "344 287 336 " , " 336 289 330 " , " 315 287 330 " , " 294 278 325 " , " 269 254 321 " ]
for x in range (0,6,1):
myInitializationArguments = "vmtkimageinitialization -ifile <PATH>"\XA_001.dcm -interactive 0 -method fastmarching -upperthreshold 11000 -lowerthreshold 2000 -sourcepoints "+seedPointsOne+" -targetpoints "+targetPointsOne[x]+" -olevelsetsfile <PATH>\initialLevelSets"+str(x+1)+".vti"
myPype = pypes.PypeRun(myinitializationArguments)
myArgumentsForMarchingCubes = "vmtkmarchingcubes –ifile <PATH>\initialLevelSets"+str(x+1)+".vti -ofile <PATH>\initialLevelSets"+str(x+1)+"mc.vtp"
myPype = pypes.PypeRun(myArgumentsForMarchingCubes)
which I include with the following LaTeX command:
\lstinputlisting[language=Python, label={lst:label32}, showstringspaces=false, extendedchars=true,keepspaces=true, tabsize=4, morekeywords={models, lambda, forms}, commentstyle={\rmfamily\catcode`\$=11}, columns=flexible,texcl,showspaces=false, captionpos=b,caption=Example of using the segmentation script with the help of the PypePad command and a Pypes object.]{./PythonCodePart.py}
My problem is that the -
signs don't appear after compiling. And there is also an issue with the construct <PATH>
…
Can someone please help me out?
Best Answer
EDIT: there's an indentation error in the for-loop, but I'm too lazy to upload a new image.
A quik'n'derty example of
minted
as an alternative to thelstlisting
-package. Taking the above codewith some clean up results in