Skip to content

Commit

Permalink
Merge branch 'release-0.1.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
mcvaneede committed Jun 10, 2015
2 parents 42a5ad7 + e6e2538 commit 4e77a15
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 25 deletions.
4 changes: 4 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
ACLOCAL_AMFLAGS = -I m4

# we are not conforming to gnu standards:
# we have README.md instead of README
AUTOMAKE_OPTIONS = foreign

SUBDIRS = src perl data

m4_files = m4/mni_REQUIRE_LIB.m4 m4/mni_REQUIRE_MNILIBS.m4 \
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
New in Version 0.1.8
====================
* clobber option in pmincaverage is activated

New in Version 0.1.7
====================
* added vtk_meshconvert.py a program that can be used to convert between BIC obj, stl and vtk meshes
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@ git submodule update --init --recursive

To build and install the perl and src code:
------------------------------------------
<pre><code>
./autogen.sh
./configure
make
make install
</pre></code>


To build and install the python scripts:
---------------------------------------
<pre><code>
python setup.py install
</pre></code>


Installation Notes:
-------------------
Expand Down
50 changes: 26 additions & 24 deletions python/pmincaverage
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

from pyminc.volumes.factory import *
from numpy import *
#from scipy.stats import *
from optparse import OptionParser
from argparse import ArgumentParser
import os.path
import sys
import multiprocessing as mp

def getslice(volhandle, slice, q,nslices):
Expand Down Expand Up @@ -31,31 +32,34 @@ def getfile(q, filename):

if __name__ == "__main__":

usage = "Usage text"
description = "Description text"

parser = OptionParser(usage=usage, description=description)
parser.add_option("--clobber", dest="clobber",
help="clobber output file",
type="string")

(options, args) = parser.parse_args()

if len(args) < 4:
parser = ArgumentParser()
g = parser.add_mutually_exclusive_group()
g.add_argument("--clobber", dest="clobber",
action="store_true",
help="clobber output file")
g.add_argument("--noclobber", dest="clobber",
action="store_false",
help="don't clobber output file (default)")
g.set_defaults(clobber=False)
parser.add_argument("infile", nargs="+", type=str, help="files to average")
parser.add_argument("outfile", type=str, help="name of file to output")

args = parser.parse_args()

infiles = args.infile
nfiles = len(infiles)
outfilename = args.outfile

if len(infiles) < 2:
parser.error("Incorrect number of arguments")

outfilename = args[-1]
# clobber check should go here
if not(args.clobber) and os.path.exists(outfilename):
sys.exit("Output file already exists; use --clobber to overwrite.")

volhandles = []

# open all the file handles
nfiles = len(args)-1
for i in range( nfiles ):
print("VOLHANDLES: %d" % i)
volhandles.append(volumeFromFile(args[i], dtype='double'))
volhandles = [volumeFromFile(f, dtype='double') for f in infiles]

outfile = volumeLikeFile(args[0], outfilename, volumeType='short')
outfile = volumeLikeFile(infiles[0], outfilename, volumeType='short')

# create the slice array
nslices = 10
Expand Down Expand Up @@ -122,5 +126,3 @@ if __name__ == "__main__":
outfile.writeFile()
outfile.closeVolume()



2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
m.Extension.__dict__ = m._Extension.__dict__

setup(name="python-stuffs",
version='0.1.7',
version='0.1.8',
scripts=["python/TFCE",
"python/smooth_vector",
"python/measure_xcorr",
Expand Down

0 comments on commit 4e77a15

Please sign in to comment.