[Scipy-svn] r3544 - trunk/scipy/ndimage/segment
scipy-svn@scip...
scipy-svn@scip...
Thu Nov 15 18:31:13 CST 2007
Author: tom.waite
Date: 2007-11-15 18:31:11 -0600 (Thu, 15 Nov 2007)
New Revision: 3544
Modified:
trunk/scipy/ndimage/segment/Segmenter_EXT.c
Log:
changed PyArray type creation for edge and mask output arrays.
Modified: trunk/scipy/ndimage/segment/Segmenter_EXT.c
===================================================================
--- trunk/scipy/ndimage/segment/Segmenter_EXT.c 2007-11-16 00:29:18 UTC (rev 3543)
+++ trunk/scipy/ndimage/segment/Segmenter_EXT.c 2007-11-16 00:31:11 UTC (rev 3544)
@@ -36,7 +36,8 @@
type = PyArray_TYPE(iArray);
num = PyArray_SIZE(iArray);
- itype = 4;
+ //itype = 4;
+ itype = NPY_USHORT;
eArray = (PyObject*)PyArray_SimpleNew(nd, dims, itype);
fP2 = (unsigned short *)PyArray_DATA(eArray);
@@ -88,7 +89,8 @@
num = PyArray_SIZE(iArray);
// this is int type and hard-wirred. pass this in from Python code
- itype = 4; // unsigned short
+ //itype = 4; // unsigned short
+ itype = NPY_USHORT;
eArray = (PyObject*)PyArray_SimpleNew(nd, dims, itype);
fP2 = (unsigned short *)PyArray_DATA(eArray);
@@ -139,7 +141,8 @@
num = PyArray_SIZE(iArray);
// this is int type and hard-wirred. pass this in from Python code
- itype = 4; // unsigned short
+ //itype = 4; // unsigned short
+ itype = NPY_USHORT;
eArray = (PyObject*)PyArray_SimpleNew(nd, dims, itype);
fP2 = (unsigned short *)PyArray_DATA(eArray);
@@ -325,7 +328,8 @@
// replace the edgeImage with maskImage
//
- if(!NI_VoxelMeasures(num, (int)dims[0], (int)dims[1], (int)objNumber[0], fP1, fP2, ROIList))
+ if(!NI_VoxelMeasures(num, (int)dims[0], (int)dims[1], (int)objNumber[0], fP1,
+ fP2, ROIList))
goto exit;
exit:
@@ -373,7 +377,8 @@
// replace the edgeImage with maskImage
//
- if(!NI_TextureMeasures(num, (int)dims[0], (int)dims[1], (int)objNumber[0], fP1, fP2, ROIList))
+ if(!NI_TextureMeasures(num, (int)dims[0], (int)dims[1], (int)objNumber[0], fP1,
+ fP2, ROIList))
goto exit;
exit:
@@ -402,7 +407,8 @@
//
// pass in 2D LPF coefficients
- if(!PyArg_ParseTuple(args, "iiiiO", &lowThreshold, &highThreshold, &closeWindow, &openWindow, &iArray))
+ if(!PyArg_ParseTuple(args, "iiiiO", &lowThreshold, &highThreshold, &closeWindow,
+ &openWindow, &iArray))
goto exit;
fP1 = (double *)PyArray_DATA(iArray);
@@ -412,7 +418,8 @@
num = PyArray_SIZE(iArray);
// this is int type and hard-wirred. pass this in from Python code
- itype = 4; // unsigned short
+ //itype = 4; // unsigned short
+ itype = NPY_USHORT;
eArray = (PyObject*)PyArray_SimpleNew(nd, dims, itype);
fP2 = (unsigned short *)PyArray_DATA(eArray);
@@ -420,8 +427,9 @@
goto exit;
- if(!NI_RegionGrow(num, (int)dims[0], (int)dims[1], lowThreshold, highThreshold, closeWindow, openWindow,
- fP1, fP2, &groups))
+ if(!NI_RegionGrow(num, (int)dims[0], (int)dims[1], lowThreshold, highThreshold,
+ closeWindow, openWindow, fP1, fP2, &groups))
+
goto exit;
exit:
More information about the Scipy-svn
mailing list