#!/usr/bin/env python
#
# Copyright (c) Madrid 2008
# BIT, ETSI Telecomunicacion, UPM
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
#
modules = {'Section' : [0, '', 'none://Section.py' ]
}
import wx
import os
import sys
from lxml import etree
from Section import *
app = wx.App()
file = open(sys.argv[1], "r")
strset = file.read()
root = etree.XML(strset)
file.close()
set = WorkSet(node=root)
if len(sys.argv) > 2:
zoom = atof(sys.argv[2])
else:
zoom = 1.0
if len(sys.argv) > 3:
shift = atof(sys.argv[3])
else:
shift = 0.0
for i in range(set.GetFrameNumber()):
frame = set.GetFrame(i)
p = frame.GetMaskedIntensities(zoom)
if len(p) != 6:
print "slice %d not segmented like it should be" % i
exit(2)
print "%f %f %f %f %f %f" % (p[0] - shift, p[1] - shift, p[2] - shift, p[3] - shift, p[4] - shift, p[5] - shift)