[Scipy-svn] r3332 - trunk/scipy/io/nifti

scipy-svn at scipy.org scipy-svn at scipy.org
Wed Sep 19 17:11:50 EDT 2007


Author: matthew.brett at gmail.com
Date: 2007-09-19 16:11:44 -0500 (Wed, 19 Sep 2007)
New Revision: 3332

Added:
   trunk/scipy/io/nifti/__init__.py
   trunk/scipy/io/nifti/nifticlib.i
   trunk/scipy/io/nifti/niftiimage.py
   trunk/scipy/io/nifti/utils.py
Removed:
   trunk/scipy/io/nifti/nifti/
   trunk/scipy/io/nifti/setup.py.orig
Modified:
   trunk/scipy/io/nifti/setup.py
Log:
get swig happening, simplify directory structure

Copied: trunk/scipy/io/nifti/__init__.py (from rev 3323, trunk/scipy/io/nifti/nifti/__init__.py)

Copied: trunk/scipy/io/nifti/nifticlib.i (from rev 3323, trunk/scipy/io/nifti/nifti/nifticlib.i)

Copied: trunk/scipy/io/nifti/niftiimage.py (from rev 3323, trunk/scipy/io/nifti/nifti/niftiimage.py)

Modified: trunk/scipy/io/nifti/setup.py
===================================================================
--- trunk/scipy/io/nifti/setup.py	2007-09-19 17:27:50 UTC (rev 3331)
+++ trunk/scipy/io/nifti/setup.py	2007-09-19 21:11:44 UTC (rev 3332)
@@ -4,7 +4,7 @@
 import sys
 import numpy
 
-nifti_wrapper_file = join('nifti', 'nifticlib.py')
+nifti_wrapper_file = join('nifticlib.py')
 
 # create an empty file to workaround crappy swig wrapper installation
 if not isfile(nifti_wrapper_file):
@@ -18,7 +18,7 @@
     from numpy.distutils.system_info import get_info
 
     config = Configuration('nifti',parent_package,top_path)
-    #config.add_data_dir('tests')
+    config.add_data_dir('tests')
 
     include_dirs = [
       '.',
@@ -26,6 +26,9 @@
       './nifticlib/niftilib',
       './nifticlib/znzlib']
 
+    nifticlib_headers = ' -I'.join(include_dirs)
+    swig_opts = ['-I'+nifticlib_headers, '-I'+numpy_headers]
+
     # Libraries
     config.add_library('fslio',
       sources=['./nifticlib/fsliolib/fslio.c'], include_dirs=include_dirs)
@@ -36,10 +39,10 @@
 
     # Extension
     config.add_extension('_nifticlib',
-      sources = ['nifticlib.i', 'nifticlib_wrap.c'],
+      sources = ['nifticlib.i'],
       include_dirs = include_dirs,
       libraries = ['niftiio', 'fslio', 'znz',],
-      swig_opts = ['-I/usr/include/nifti', '-I'+numpy_headers])
+      swig_opts = swig_opts)
 
     return config
 

Deleted: trunk/scipy/io/nifti/setup.py.orig
===================================================================
--- trunk/scipy/io/nifti/setup.py.orig	2007-09-19 17:27:50 UTC (rev 3331)
+++ trunk/scipy/io/nifti/setup.py.orig	2007-09-19 21:11:44 UTC (rev 3332)
@@ -1,56 +0,0 @@
-#!/usr/bin/env python
-
-### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
-#
-#    Python distutils setup for PyNifti
-#
-#    Copyright (C) 2006-2007 by
-#    Michael Hanke <michael.hanke at gmail.com>
-#
-#    This package is free software; you can redistribute it and/or
-#    modify it under the terms of the GNU Lesser General Public
-#    version 2 of the License, or (at your option) any later version.
-#
-#    This package 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
-#    Lesser General Public License for more details.
-#
-### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
-
-from distutils.core import setup, Extension
-import os
-import numpy
-from glob import glob
-
-nifti_wrapper_file = os.path.join('nifti', 'nifticlib.py')
-
-# create an empty file to workaround crappy swig wrapper installation
-if not os.path.isfile(nifti_wrapper_file):
-    open(nifti_wrapper_file, 'w')
-
-# find numpy headers
-numpy_headers = os.path.join(os.path.dirname(numpy.__file__),'core','include')
-
-
-# Notes on the setup
-# Version scheme is:
-# 0.<4-digit-year><2-digit-month><2-digit-day>.<ever-increasing-integer>
-
-setup(name       = 'pynifti',
-    version      = '0.20070905.1',
-    author       = 'Michael Hanke',
-    author_email = 'michael.hanke at gmail.com',
-    license      = 'LGPL',
-    url          = 'http://apsy.gse.uni-magdeburg.de/hanke',
-    description  = 'Python interface for the NIfTI IO libraries',
-    long_description = """ """,
-    packages     = [ 'nifti' ],
-    scripts      = glob( 'bin/*' ),
-    ext_modules  = [ Extension( 'nifti._nifticlib', [ 'nifti/nifticlib.i' ],
-            include_dirs = [ '/usr/include/nifti', numpy_headers ],
-            libraries    = [ 'niftiio' ],
-            swig_opts    = [ '-I/usr/include/nifti',
-                             '-I' + numpy_headers ] ) ]
-    )
-

Copied: trunk/scipy/io/nifti/utils.py (from rev 3323, trunk/scipy/io/nifti/nifti/utils.py)




More information about the Scipy-svn mailing list