From 596ee18da91b368af253bd83a2224c65d8891061 Mon Sep 17 00:00:00 2001 From: Luv Sharma Date: Sun, 8 Jun 2014 14:43:32 +0000 Subject: [PATCH] improved the regex for header reading --- processing/post/3Dvisualize.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/processing/post/3Dvisualize.py b/processing/post/3Dvisualize.py index 947e95ae9..336de8b00 100755 --- a/processing/post/3Dvisualize.py +++ b/processing/post/3Dvisualize.py @@ -348,13 +348,14 @@ options.scaling = map(float, options.scaling) if numpy.any(options.scaling != 1.0) and options.linearreconstruction: print 'cannot scale for linear reconstruction' if numpy.any(options.scaling != 1.0) and options.filenodalcoords != '': print 'cannot scale when reading coordinate from file' options.separator = options.separator.lower() + for filename in args: if not os.path.exists(filename): continue file = open(filename) content = file.readlines() file.close() - m = re.search('(\d+)\shead',content[0],re.I) + m = re.search('(\d+)\s*head', content[0].lower()) if m == None: continue print filename,'\n' @@ -431,7 +432,7 @@ for filename in args: grid = numpy.array([len(tempGrid[0]),\ len(tempGrid[1]),\ len(tempGrid[2]),],'i') - + dim = numpy.ones(3) for i,r in enumerate(grid): @@ -442,7 +443,7 @@ for filename in args: dim[2] = min(dim/grid) else: dim[2] = options.unitlength - + print dim if options.undeformed: Favg = numpy.eye(3) else: