62 #define PyDataObject_Check(op) PyObject_TypeCheck(op, &PythonDataObject::PyDataObjectType)
64 static inline void PyDataObject_SetBase(
PyDataObject *op, PyObject *base )
66 PyObject* x = op->base;
76 static void PyDataObject_dealloc(PyDataObject *self);
77 static PyObject *PyDataObject_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
78 static int PyDataObject_init(PyDataObject *self, PyObject *args, PyObject *kwds);
83 static PyObject *PyDataObject_name(PyDataObject *self);
85 static PyObject* PyDataObject_repr(PyDataObject *self);
87 static PyObject* PyDataObject_data(PyDataObject *self);
88 static PyObject* PyDataObject_conj(PyDataObject *self);
89 static PyObject* PyDataObject_conjugate(PyDataObject *self);
90 static PyObject* PyDataObject_adj(PyDataObject *self);
91 static PyObject* PyDataObject_adjugate(PyDataObject *self);
92 static PyObject* PyDataObject_trans(PyDataObject *self);
93 static PyObject* PyDataObject_copy(PyDataObject *self, PyObject* args, PyObject *kwds);
94 static PyObject* PyDataObject_astype(PyDataObject *self, PyObject* args, PyObject* kwds);
95 static PyObject* PyDataObject_normalize(PyDataObject *self, PyObject* args, PyObject* kwds);
96 static PyObject* PyDataObject_size(PyDataObject *self, PyObject* args);
97 static PyObject* PyDataObject_makeContinuous(PyDataObject *self);
98 static PyObject* PyDataObject_locateROI(PyDataObject *self);
99 static PyObject* PyDataObject_adjustROI(PyDataObject *self, PyObject* args, PyObject *kwds);
100 static PyObject* PyDataObject_squeeze(PyDataObject *self, PyObject* args);
102 static PyObject* PyDataObject_mul(PyDataObject *self, PyObject *args);
103 static PyObject* PyDataObject_div(PyDataObject *self, PyObject *args);
105 static PyObject* PyDataObject_reshape(PyDataObject *self, PyObject *args, PyObject *kwds);
107 static PyObject* PyDataObject_createMask(PyDataObject *self, PyObject *args, PyObject* kwds);
110 static PyObject* PyDataObj_SetAxisOffset(PyDataObject *self, PyObject *args);
111 static PyObject* PyDataObj_SetAxisScale(PyDataObject *self, PyObject *args);
112 static PyObject* PyDataObj_SetAxisDescription(PyDataObject *self, PyObject *args);
113 static PyObject* PyDataObj_SetAxisUnit(PyDataObject *self, PyObject *args);
114 static PyObject* PyDataObj_PhysToPix(PyDataObject *self, PyObject *args, PyObject *kwds);
115 static PyObject* PyDataObj_PixToPhys(PyDataObject *self, PyObject *args, PyObject *kwds);
116 static PyObject* PyDataObj_CopyMetaInfo(PyDataObject *self, PyObject *args, PyObject *kwds);
118 static PyObject* PyDataObj_SetTag(PyDataObject *self, PyObject *args);
119 static PyObject* PyDataObj_DeleteTag(PyDataObject *self, PyObject *args);
120 static PyObject* PyDataObj_TagExists(PyDataObject *self, PyObject *args);
121 static PyObject* PyDataObj_GetTagListSize(PyDataObject *self);
122 static PyObject* PyDataObj_AddToProtocol(PyDataObject *self, PyObject *args);
126 static PyObject* PyDataObject_RichCompare(PyDataObject *self, PyObject *other,
int cmp_op);
128 static PyGetSetDef PyDataObject_getseters[];
129 static PyObject* PyDataObj_GetDims(PyDataObject *self,
void *closure);
130 static PyObject* PyDataObj_GetType(PyDataObject *self,
void *closure);
131 static PyObject* PyDataObj_GetShape(PyDataObject *self,
void *closure);
132 static PyObject* PyDataObj_GetContinuous(PyDataObject *self,
void *closure);
134 static PyObject* PyDataObject_getTagDict(PyDataObject *self,
void *closure);
135 static int PyDataObject_setTagDict(PyDataObject *self, PyObject *value,
void *closure);
137 static PyObject* PyDataObject_getTags(PyDataObject *self,
void *closure);
138 static int PyDataObject_setTags(PyDataObject *self, PyObject *value,
void *closure);
140 static PyObject* PyDataObject_getAxisScales(PyDataObject *self,
void *closure);
141 static int PyDataObject_setAxisScales(PyDataObject *self, PyObject *value,
void *closure);
143 static PyObject* PyDataObject_getAxisOffsets(PyDataObject *self,
void *closure);
144 static int PyDataObject_setAxisOffsets(PyDataObject *self, PyObject *value,
void *closure);
146 static PyObject* PyDataObject_getAxisDescriptions(PyDataObject *self,
void *closure);
147 static int PyDataObject_setAxisDescriptions(PyDataObject *self, PyObject *value,
void *closure);
149 static PyObject* PyDataObject_getAxisUnits(PyDataObject *self,
void *closure);
150 static int PyDataObject_setAxisUnits(PyDataObject *self, PyObject *value,
void *closure);
152 static PyObject* PyDataObject_getValueUnit(PyDataObject *self,
void *closure);
153 static int PyDataObject_setValueUnit(PyDataObject *self, PyObject *value,
void *closure);
155 static PyObject* PyDataObject_getValueDescription(PyDataObject *self,
void *closure);
156 static int PyDataObject_setValueDescription(PyDataObject *self, PyObject *value,
void *closure);
158 static PyObject* PyDataObject_getValueScale(PyDataObject *self,
void *closure);
159 static PyObject* PyDataObject_getValueOffset(PyDataObject *self,
void *closure);
161 static PyObject* PyDataObject_getReal(PyDataObject *self,
void *closure);
162 static int PyDataObject_setReal(PyDataObject *self, PyObject *value,
void *closure);
164 static PyObject* PyDataObject_getImag(PyDataObject *self,
void *closure);
165 static int PyDataObject_setImag(PyDataObject *self, PyObject *value,
void *closure);
167 static PyObject* PyDataObject_abs(PyDataObject *self,
void *closure);
168 static PyObject* PyDataObject_arg(PyDataObject *self,
void *closure);
170 static int PyDataObject_setXYRotationalMatrix(PyDataObject *self, PyObject *value,
void *closure);
171 static PyObject* PyDataObject_getXYRotationalMatrix(PyDataObject *self,
void *closure);
173 static PyObject* PyDataObject_getValue(PyDataObject *self,
void *closure);
174 static int PyDataObject_setValue(PyDataObject *self, PyObject *value,
void *closure);
176 static PyObject* PyDataObject_transpose(PyDataObject *self,
void *closure);
178 static PyObject* PyDataObj_Array_StructGet(PyDataObject *self);
179 static PyObject* PyDataObj_Array_Interface(PyDataObject *self);
180 static PyObject* PyDataObj_Array_(PyDataObject *self, PyObject *args);
182 static PyObject* PyDataObject_real(PyDataObject *self);
183 static PyObject* PyDataObject_imag(PyDataObject *self);
185 static PyObject* PyDataObj_ToGray(PyDataObject *self, PyObject *args, PyObject *kwds);
186 static PyObject* PyDataObj_ToNumpyColor(PyDataObject *self, PyObject *args, PyObject *kwds);
187 static PyObject* PyDataObj_SplitColor(PyDataObject *self, PyObject *args, PyObject *kwds);
189 static PyObject* PyDataObj_ToList(PyDataObject *self);
190 static PyObject* PyDataObj_At(
ito::DataObject *dataObj,
const unsigned int *idx);
191 static PyObject* PyDataObj_ToListRecursive(
ito::DataObject *dataObj,
unsigned int *currentIdx,
int iterationIndex);
194 static void PyDataObj_Capsule_Destructor(PyObject* capsule);
196 static PyObject* PyDataObj_Reduce(PyDataObject *self, PyObject *args);
197 static PyObject* PyDataObj_SetState(PyDataObject *self, PyObject *args);
198 static PyObject* PyDataObj_lineCut(PyDataObject *self, PyObject *args);
208 static PyObject* PyDataObj_nbAdd(PyObject* o1, PyObject* o2);
209 static PyObject* PyDataObj_nbSubtract(PyObject* o1, PyObject* o2);
210 static PyObject* PyDataObj_nbMultiply(PyObject* o1, PyObject* o2);
211 static PyObject* PyDataObj_nbMatrixMultiply(PyObject* o1, PyObject* o2);
212 static PyObject* PyDataObj_nbDivide(PyObject* o1, PyObject* o2);
213 static PyObject* PyDataObj_nbRemainder(PyObject* o1, PyObject* o2);
214 static PyObject* PyDataObj_nbDivmod(PyObject* o1, PyObject* o2);
215 static PyObject* PyDataObj_nbPower(PyObject* o1, PyObject* o2, PyObject* o3);
216 static PyObject* PyDataObj_nbNegative(PyObject* o1);
217 static PyObject* PyDataObj_nbPositive(PyObject* o1);
218 static PyObject* PyDataObj_nbAbsolute(PyObject* o1);
219 static PyObject* PyDataObj_nbInvert(PyObject* o1);
220 static PyObject* PyDataObj_nbLshift(PyObject* o1, PyObject* o2);
221 static PyObject* PyDataObj_nbRshift(PyObject* o1, PyObject* o2);
222 static PyObject* PyDataObj_nbAnd(PyObject* o1, PyObject* o2);
223 static PyObject* PyDataObj_nbXor(PyObject* o1, PyObject* o2);
224 static PyObject* PyDataObj_nbOr(PyObject* o1, PyObject* o2);
225 static int PyDataObj_nbBool(PyDataObject *self);
226 static PyObject* PyDataObj_nbInplaceAdd(PyObject* o1, PyObject* o2);
227 static PyObject* PyDataObj_nbInplaceSubtract(PyObject* o1, PyObject* o2);
228 static PyObject* PyDataObj_nbInplaceMultiply(PyObject* o1, PyObject* o2);
229 static PyObject* PyDataObj_nbInplaceRemainder(PyObject* o1, PyObject* o2);
230 static PyObject* PyDataObj_nbInplacePower(PyObject* o1, PyObject* o2, PyObject* o3);
231 static PyObject* PyDataObj_nbInplaceLshift(PyObject* o1, PyObject* o2);
232 static PyObject* PyDataObj_nbInplaceRshift(PyObject* o1, PyObject* o2);
233 static PyObject* PyDataObj_nbInplaceAnd(PyObject* o1, PyObject* o2);
234 static PyObject* PyDataObj_nbInplaceXor(PyObject* o1, PyObject* o2);
235 static PyObject* PyDataObj_nbInplaceOr(PyObject* o1, PyObject* o2);
236 static PyObject* PyDataObj_nbInplaceTrueDivide(PyObject* o1, PyObject* o2);
237 static PyObject* PyDataObj_nbInplaceMatrixMultiply(PyObject* o1, PyObject* o2);
242 static PyObject* PyDataObj_getiter(PyDataObject* self);
247 static int PyDataObj_mappingLength(PyDataObject* self);
248 static PyObject* PyDataObj_mappingGetElem(PyDataObject* self, PyObject* key);
249 static int PyDataObj_mappingSetElem(PyDataObject* self, PyObject* key, PyObject* value);
254 static PyMemberDef PyDataObject_members[];
255 static PyMethodDef PyDataObject_methods[];
256 static PyTypeObject PyDataObjectType;
257 static PyModuleDef PyDataObjectModule;
259 static PyNumberMethods PyDataObject_numberProtocol;
260 static PyMappingMethods PyDataObject_mappingProtocol;
265 static RetVal PyDataObj_ParseCreateArgs(PyObject *args, PyObject *kwds,
int &typeno, std::vector<unsigned int> &dims,
unsigned char &continuous);
267 static PyDataObjectTypes PyDataObject_types[];
268 static int dObjTypeFromName(
const char *name);
269 static const char* typeNumberToName(
int typeno);
270 static int numDataTypes();
272 static PyDataObject* createEmptyPyDataObject();
273 static PyObject* createPyDataObjectFromArray(PyObject *npArray);
275 static bool checkPyDataObject(
int number, PyObject* o1 = NULL, PyObject* o2 = NULL, PyObject* o3 = NULL);
277 static RetVal parseTypeNumber(
int typeno,
char &typekind,
int &itemsize);
278 static int getDObjTypeOfNpArray(
char typekind,
int itemsize);
279 static int getCompatibleDObjTypeOfNpArray(
char typekind,
int itemsize);
280 static int getNpTypeFromDataObjectType(
int type);
281 static std::string getNpDTypeStringFromNpDTypeEnum(
const int type);
284 static int PyDataObj_CreateFromShapeTypeData(PyDataObject *self, PyObject *args, PyObject *kwds);
285 static int PyDataObj_CreateFromNpNdArrayAndType(PyDataObject *self, PyObject *args, PyObject *kwds,
bool addNpOrgTags);
286 static bool PyDataObj_CopyFromDatetimeNpNdArray(PyDataObject *self, PyArrayObject *dateTimeArray,
int dims,
const int* sizes);
287 static bool PyDataObj_CopyFromTimedeltaNpNdArray(PyDataObject *self, PyArrayObject *timeDeltaArray,
int dims,
const int* sizes);
294 static PyObject* PyDataObj_StaticZeros(PyObject *self, PyObject *args, PyObject *kwds);
295 static PyObject* PyDataObj_StaticOnes(PyObject *self, PyObject *args, PyObject *kwds);
296 static PyObject* PyDataObj_StaticNans(PyObject *self, PyObject *args, PyObject *kwds);
297 static PyObject* PyDataObj_StaticRand(PyObject *self, PyObject *args, PyObject *kwds);
298 static PyObject* PyDataObj_StaticRandN(PyObject *self, PyObject *args, PyObject *kwds);
299 static PyObject* PyDataObj_StaticEye(PyObject *self, PyObject *args, PyObject *kwds);
300 static PyObject* PyDataObj_StaticFromNumpyColor(PyObject *self, PyObject *args, PyObject *kwds);
301 static PyObject* PyDataObj_dstack(PyObject *self, PyObject *args, PyObject *kwds);
324 static PyObject *PyDataObjectIter_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
325 static int PyDataObjectIter_init(
PyDataObjectIter *self, PyObject *args, PyObject *kwds);
333 static PyMethodDef PyDataObjectIter_methods[];
334 static PyTypeObject PyDataObjectIterType;