VMTK Users,

    With regards to the problem that I posted about trouble I was having with 
vmtkimagevoipainter, I have not figured out how to resolve this yet. I have 
figured out that the bounding box in the output has the same dimensions as the 
bounding box chosen as an input, however, its output location in the image set 
is offset towards the corner of the entire input VOI. Additionally, the output 
paint value does correspond to the input value specified using the option 
"-paintvalue".

   Ben Berkowitz helped me simplify the vmtkimagevoipainter script by writing 
the python script at the end of this email. It is intended to take in a vtk 
image file and the bounding coordinates (min and max for x, y, and z) for the 
region we wish to "paint". This script gives the same output as the 
vmtkimagevoipainter script. It seems that the vtkvmtk.vtkvmtkImageBoxPainter() 
script is reading in the input just fine, but can't process where to place the 
region to be painted in the output image. I'm not exactly sure where to go from 
here to help correct this. If anybody has any suggestions, I'd greatly 
appreciate your input.

Thanks for your time,
Ben Dickerhoff

import vtk
import sys
import math
from vmtk import vtkvmtk
from vmtk import vmtkscripts

file = sys.argv[1]

reader = vmtkscripts.vmtkImageReader()
reader.InputFileName = file
reader.Execute()

xmin = float(sys.argv[2])
xmax = float(sys.argv[3])
ymin = float(sys.argv[4])
ymax = float(sys.argv[5])
zmin = float(sys.argv[6])
zmax = float(sys.argv[7])

extents = [xmin, xmax, ymin, ymax, zmin, zmax]

imageBoxPainter = vtkvmtk.vtkvmtkImageBoxPainter()
imageBoxPainter.SetInput(reader.Image)
imageBoxPainter.SetBoxExtent(extents)
imageBoxPainter.SetBoxDefinitionToUseExtent()
imageBoxPainter.SetPaintValue(10)
imageBoxPainter.Update()

writer = vmtkscripts.vmtkImageWriter()
writer.Image = imageBoxPainter.GetOutput()
writer.OutputFileName = file[:-4]+'_painted.vti'
writer.Execute()

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
vmtk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vmtk-users

Reply via email to