+bool\r
+ImageFile::convertRealToComplex ()\r
+{\r
+ if (dataType() != Array2dFile::DATA_TYPE_REAL)\r
+ return false;\r
+\r
+ if (! reallocRealToComplex())\r
+ return false;\r
+\r
+ ImageFileArray vImag = getImaginaryArray();\r
+ for (unsigned int ix = 0; ix < m_nx; ix++) {\r
+ ImageFileColumn vCol = vImag[ix];\r
+ for (unsigned int iy = 0; iy < m_ny; iy++)\r
+ *vCol++ = 0;\r
+ }\r
+\r
+ return true;\r
+}\r
+\r
+bool\r
+ImageFile::convertComplexToReal ()\r
+{\r
+ if (dataType() != Array2dFile::DATA_TYPE_COMPLEX)\r
+ return false;\r
+\r
+ ImageFileArray vReal = getArray();\r
+ ImageFileArray vImag = getImaginaryArray();\r
+ for (unsigned int ix = 0; ix < m_nx; ix++) {\r
+ ImageFileColumn vRealCol = vReal[ix];\r
+ ImageFileColumn vImagCol = vImag[ix];\r
+ for (unsigned int iy = 0; iy < m_ny; iy++) {\r
+ std::complex<double> c (*vRealCol, *vImagCol);\r
+ *vRealCol++ = std::abs (c);\r
+ vImagCol++;\r
+ }\r
+ }\r
+\r
+ return reallocComplexToReal();\r
+}\r
+\r