From ab78de6e33fff94c37847621458db3ad430a8bb3 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Thu, 27 Jun 2002 03:19:23 +0000 Subject: [PATCH] r2169: *** empty log message *** --- ChangeLog | 11 +- debian/changelog | 6 + debian/control | 2 +- include/interpolator.h | 14 +- libctsim/ctndicom.cpp | 152 ++++++++++++-------- libctsim/imagefile.cpp | 20 +-- libctsim/projections.cpp | 10 +- src/ctsim.cpp | 13 +- src/ctsim.xpm | 293 --------------------------------------- src/graph3dview.cpp | 35 +++-- 10 files changed, 158 insertions(+), 398 deletions(-) diff --git a/ChangeLog b/ChangeLog index a09180a..3e71b69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,13 @@ -Jul 1, 2002 Version 3.5.6 +Jun 26, 2002 Version 3.5.6 - * Bug fix for Debian alpha platform + * Fix minor color PNG image importing bug + + * Bug fix for building on Debian alpha platform - * Fix some compilation warnings + * Fix g++ compilation warnings + +Jun 13, 2002 Version 3.5.5 -Jun 20, 2002 Version 3.5.5 * Fix printing of version number * Minor bug fixes diff --git a/debian/changelog b/debian/changelog index 997eb63..2147d74 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ctsim (3.5.6) unstable; urgency=low + + * New upstream version + + -- Kevin Rosenberg Wed, 26 Jun 2002 21:10:45 -0600 + ctsim (3.5.5-1) unstable; urgency=low * New upstream version diff --git a/debian/control b/debian/control index b685a25..4e74220 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: science Priority: optional Maintainer: Kevin Rosenberg Uploaders: Barak A. Pearlmutter -Build-Depends: debhelper (>> 3.0.0), wxwin2.2-headers, fftw-dev, libreadline4-dev, xlibmesa-dev, libwxgtk2.2-dev , glutg3-dev, ctn-dev +Build-Depends: debhelper (>= 4.0.0), wxwin2.2-headers, fftw-dev, libreadline4-dev, xlibmesa-dev, libwxgtk2.2-dev , glutg3-dev, ctn-dev Standards-Version: 3.5.2 Package: ctsim diff --git a/include/interpolator.h b/include/interpolator.h index 94b9b12..267c937 100644 --- a/include/interpolator.h +++ b/include/interpolator.h @@ -2,7 +2,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: interpolator.h,v 1.6 2002/06/27 01:48:25 kevin Exp $ +** $Id: interpolator.h,v 1.7 2002/06/27 03:19:23 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -103,10 +103,10 @@ public: T interpolate (double dXPos, double dYPos) { - int iFloorX = floor (dXPos); - int iFloorY = floor (dYPos); - double dXFrac = dXPos - iFloorX; - double dYFrac = dYPos - iFloorY; + // int iFloorX = static_cast(floor (dXPos)); + // int iFloorY = static_cast(floor (dYPos)); + // double dXFrac = dXPos - iFloorX; + // double dYFrac = dYPos - iFloorY; T result = 0; @@ -122,7 +122,7 @@ class LinearInterpolator { private: T* const m_pX; T* const m_pY; - const unsigned int m_n; + const int m_n; const bool m_bZeroOutsideRange; public: @@ -154,7 +154,7 @@ public: else result = m_pY[m_n - 1]; } else { - int iFloor = floor(dX); + int iFloor = static_cast(floor(dX)); result = m_pY[iFloor] + (m_pY[iFloor+1] - m_pY[iFloor]) * (dX - iFloor); } } else { diff --git a/libctsim/ctndicom.cpp b/libctsim/ctndicom.cpp index 82d35e1..eca164d 100644 --- a/libctsim/ctndicom.cpp +++ b/libctsim/ctndicom.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: ctndicom.cpp,v 1.15 2002/06/27 01:48:26 kevin Exp $ +** $Id: ctndicom.cpp,v 1.16 2002/06/27 03:19:23 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -60,12 +60,18 @@ DicomImporter::DicomImporter (const char* const pszFile) unsigned short iNRows, iNCols, iBitsAllocated, iBitsStored, iHighBit, iPixRep; DCM_ELEMENT aElemRequired[] = { - {DCM_IMGROWS, DCM_US, "", 1, sizeof(iNRows), reinterpret_cast(&iNRows),}, - {DCM_IMGCOLUMNS, DCM_US, "", 1, sizeof(iNCols), reinterpret_cast(&iNCols),}, - {DCM_IMGBITSALLOCATED, DCM_US, "", 1, sizeof(iBitsAllocated), reinterpret_cast(&iBitsAllocated),}, - {DCM_IMGBITSSTORED, DCM_US, "", 1, sizeof(iBitsStored), reinterpret_cast(&iBitsStored),}, - {DCM_IMGHIGHBIT, DCM_US, "", 1, sizeof(iHighBit), reinterpret_cast(&iHighBit),}, - {DCM_IMGPIXELREPRESENTATION, DCM_US, "", 1, sizeof(iPixRep), reinterpret_cast(&iPixRep),}, + {DCM_IMGROWS, DCM_US, "", 1, sizeof(iNRows), + {reinterpret_cast(&iNRows)}}, + {DCM_IMGCOLUMNS, DCM_US, "", 1, sizeof(iNCols), + {reinterpret_cast(&iNCols)}}, + {DCM_IMGBITSALLOCATED, DCM_US, "", 1, sizeof(iBitsAllocated), + {reinterpret_cast(&iBitsAllocated)}}, + {DCM_IMGBITSSTORED, DCM_US, "", 1, sizeof(iBitsStored), + {reinterpret_cast(&iBitsStored)}}, + {DCM_IMGHIGHBIT, DCM_US, "", 1, sizeof(iHighBit), + {reinterpret_cast(&iHighBit)}}, + {DCM_IMGPIXELREPRESENTATION, DCM_US, "", 1, sizeof(iPixRep), + {reinterpret_cast(&iPixRep)}}, }; int nElemRequired = sizeof (aElemRequired) / sizeof(DCM_ELEMENT); @@ -86,10 +92,12 @@ DicomImporter::loadImage(unsigned short iNRows, unsigned short iNCols, unsigned U32 lRtnLength; unsigned short iSamplesPerPixel, iPlanarConfig; - DCM_ELEMENT elemPlanarConfig = {DCM_IMGPLANARCONFIGURATION, DCM_US, "", 1, sizeof(iPlanarConfig), - reinterpret_cast(&iPlanarConfig)}; - DCM_ELEMENT elemSamplesPerPixel = {DCM_IMGSAMPLESPERPIXEL, DCM_US, "", 1, - sizeof(iSamplesPerPixel), reinterpret_cast(&iSamplesPerPixel)}; + DCM_ELEMENT elemPlanarConfig = + {DCM_IMGPLANARCONFIGURATION, DCM_US, "", 1, sizeof(iPlanarConfig), + {reinterpret_cast(&iPlanarConfig)}}; + DCM_ELEMENT elemSamplesPerPixel = + {DCM_IMGSAMPLESPERPIXEL, DCM_US, "", 1, + sizeof(iSamplesPerPixel), {reinterpret_cast(&iSamplesPerPixel)}}; if (DCM_ParseObject (&m_pFile, &elemSamplesPerPixel, 1, NULL, 0, NULL) != DCM_NORMAL) iSamplesPerPixel = 1; // default value @@ -106,8 +114,12 @@ DicomImporter::loadImage(unsigned short iNRows, unsigned short iNCols, unsigned char szRescaleIntercept[17]; double dRescaleSlope = 1; double dRescaleIntercept = 0; - DCM_ELEMENT elemRescaleSlope = {DCM_IMGRESCALESLOPE, DCM_DS, "", 1, strlen(szRescaleSlope), szRescaleSlope}; - DCM_ELEMENT elemRescaleIntercept = {DCM_IMGRESCALEINTERCEPT, DCM_DS, "", 1, strlen(szRescaleIntercept), szRescaleIntercept}; + DCM_ELEMENT elemRescaleSlope = + {DCM_IMGRESCALESLOPE, DCM_DS, "", 1, strlen(szRescaleSlope), + {szRescaleSlope}}; + DCM_ELEMENT elemRescaleIntercept = + {DCM_IMGRESCALEINTERCEPT, DCM_DS, "", 1, strlen(szRescaleIntercept), + {szRescaleIntercept}}; if (DCM_ParseObject (&m_pFile, &elemRescaleSlope, 1, NULL, 0, NULL) == DCM_NORMAL) { if (sscanf (szRescaleSlope, "%lf", &dRescaleSlope) != 1) sys_error (ERR_SEVERE, "Error parsing rescale slope"); @@ -117,7 +129,7 @@ DicomImporter::loadImage(unsigned short iNRows, unsigned short iNCols, unsigned sys_error (ERR_SEVERE, "Error parsing rescale intercept"); } - DCM_ELEMENT elemPixelData = {DCM_PXLPIXELDATA, DCM_OT, "", 1, 0, NULL}; + DCM_ELEMENT elemPixelData = {DCM_PXLPIXELDATA, DCM_OT, "", 1, 0, {NULL}}; // Get the actual pixel data (the only other required element) if (DCM_GetElementSize (&m_pFile, elemPixelData.tag, &lRtnLength) != DCM_NORMAL) { m_bFail = true; @@ -188,8 +200,10 @@ DicomImporter::loadProjections() unsigned short iNViews, iNDets; DCM_ELEMENT aElemRequired[] = { - {DCM_IMGROWS, DCM_US, "", 1, sizeof(iNViews), reinterpret_cast(&iNViews)}, - {DCM_IMGCOLUMNS, DCM_US, "", 1, sizeof(iNDets), reinterpret_cast(&iNDets)}, + {DCM_IMGROWS, DCM_US, "", 1, sizeof(iNViews), + {reinterpret_cast(&iNViews)}}, + {DCM_IMGCOLUMNS, DCM_US, "", 1, sizeof(iNDets), + {reinterpret_cast(&iNDets)}}, }; int nElemRequired = sizeof (aElemRequired) / sizeof(DCM_ELEMENT); @@ -200,7 +214,7 @@ DicomImporter::loadProjections() } DCM_TAG somatomTag = DCM_MAKETAG(TAG_GROUP_SOMATOM, TAG_MEMBER_SOMATOM_DATA); - DCM_ELEMENT elemProjections = {somatomTag, DCM_UN, "", 1, 0, NULL}; + DCM_ELEMENT elemProjections = {somatomTag, DCM_UN, "", 1, 0, {NULL}}; if (DCM_GetElementSize (&m_pFile, elemProjections.tag, &lRtnLength) != DCM_NORMAL) { m_bFail = true; m_strFailMessage = "Can't find projection data"; @@ -356,51 +370,77 @@ DicomExporter::createDicomObject() unsigned short iPixRep = 0; unsigned short iSamplesPerPixel = 1; DCM_ELEMENT aElemRequired[] = { - {DCM_IMGROWS, DCM_US, "", 1, sizeof(iNRows), reinterpret_cast(&iNRows)}, - {DCM_IMGCOLUMNS, DCM_US, "", 1, sizeof(iNCols), reinterpret_cast(&iNCols)}, - {DCM_IMGBITSALLOCATED, DCM_US, "", 1, sizeof(iBitsAllocated), reinterpret_cast(&iBitsAllocated)}, - {DCM_IMGBITSSTORED, DCM_US, "", 1, sizeof(iBitsStored), reinterpret_cast(&iBitsStored)}, - {DCM_IMGHIGHBIT, DCM_US, "", 1, sizeof(iHighBit), reinterpret_cast(&iHighBit)}, - {DCM_IMGPIXELREPRESENTATION, DCM_US, "", 1, sizeof(iPixRep), reinterpret_cast(&iPixRep)}, - {DCM_IMGSAMPLESPERPIXEL, DCM_US, "", 1, sizeof(iSamplesPerPixel), reinterpret_cast(&iSamplesPerPixel)}, - {DCM_IMGRESCALESLOPE, DCM_DS, "", 1, strlen(szRescaleSlope), szRescaleSlope}, - {DCM_IMGRESCALEINTERCEPT, DCM_DS, "", 1, strlen(szRescaleIntercept), szRescaleIntercept}, - {DCM_IMGPHOTOMETRICINTERP, DCM_CS, "", 1, strlen(szImgPhotometricInterp), szImgPhotometricInterp}, - {DCM_IMGPIXELSPACING, DCM_DS, "", 1, strlen(szPixelSpacing), szPixelSpacing}, - {DCM_RELIMAGEORIENTATIONPATIENT, DCM_DS, "", 1, strlen(szRelImageOrientationPatient), szRelImageOrientationPatient}, - {DCM_RELIMAGEPOSITIONPATIENT, DCM_DS, "", 1, strlen(szRelImagePositionPatient), szRelImagePositionPatient}, - {DCM_ACQKVP, DCM_DS, "", 1, strlen(szAcqKvp), szAcqKvp}, - {DCM_RELACQUISITIONNUMBER, DCM_IS, "", 1, strlen(szRelAcquisitionNumber), szRelAcquisitionNumber}, - {DCM_ACQSLICETHICKNESS, DCM_DS, "", 1, strlen(szRelAcquisitionNumber), szRelAcquisitionNumber}, - {DCM_RELIMAGENUMBER, DCM_IS, "", 1, strlen(szRelImageNumber), szRelImageNumber}, - {DCM_IDSOPINSTANCEUID, DCM_UI, "", 1, strlen(szIDSOPInstanceUID), szIDSOPInstanceUID}, - {DCM_IDMANUFACTURER, DCM_LO, "", 1, strlen(szIDManufacturer), szIDManufacturer}, - {DCM_RELPOSITIONREFINDICATOR, DCM_LO, "", 1, strlen(szRelPositionRefIndicator), szRelPositionRefIndicator}, - {DCM_RELFRAMEOFREFERENCEUID, DCM_UI, "", 1, strlen(szRelFrameOfReferenceUID), szRelFrameOfReferenceUID}, - {DCM_RELSERIESNUMBER, DCM_IS, "", 1, strlen(szRelSeriesNumber), szRelSeriesNumber}, - {DCM_RELSERIESINSTANCEUID, DCM_UI, "", 1, strlen(szIDAccessionNumber), szIDAccessionNumber}, - {DCM_IDACCESSIONNUMBER, DCM_SH, "", 1, strlen(szIDAccessionNumber), szIDAccessionNumber}, - {DCM_RELSTUDYID, DCM_SH, "", 1, strlen(szRelStudyID), szRelStudyID}, - {DCM_IDREFERRINGPHYSICIAN, DCM_PN, "", 1, strlen(szIDReferringPhysician), szIDReferringPhysician}, - {DCM_IDSTUDYTIME, DCM_TM, "", 1, strlen(szIDStudyTime), szIDStudyTime}, - {DCM_IDSTUDYDATE, DCM_DA, "", 1, strlen(szIDStudyDate), szIDStudyDate}, - {DCM_RELSTUDYINSTANCEUID, DCM_UI, "", 1, strlen(szRelStudyInstanceUID), szRelStudyInstanceUID}, - {DCM_PATSEX, DCM_CS, "", 1, strlen(szPatSex), szPatSex}, - {DCM_PATBIRTHDATE, DCM_DA, "", 1, strlen(szPatBirthdate), szPatBirthdate}, - {DCM_PATID, DCM_LO, "", 1, strlen(szPatID), szPatID}, - {DCM_PATNAME, DCM_PN, "", 1, strlen(szPatName), szPatName}, - {DCM_IDIMAGETYPE, DCM_CS, "", 1, strlen(szIDImageType), szIDImageType}, - {DCM_IDMODALITY, DCM_CS, "", 1, strlen(szModality), szModality}, - {DCM_IDSOPCLASSUID, DCM_UI, "", 1, strlen(szSOPClassUID), szSOPClassUID}, - {DCM_IDMANUFACTURERMODEL, DCM_LO, "", 1, strlen(szIDManufacturerModel), szIDManufacturerModel}, - {DCM_PATCOMMENTS, DCM_LT, "", 1, strlen(pszPatComments), pszPatComments}, + {DCM_IMGROWS, DCM_US, "", 1, sizeof(iNRows), + {reinterpret_cast(&iNRows)}}, + {DCM_IMGCOLUMNS, DCM_US, "", 1, sizeof(iNCols), + {reinterpret_cast(&iNCols)}}, + {DCM_IMGBITSALLOCATED, DCM_US, "", 1, sizeof(iBitsAllocated), + {reinterpret_cast(&iBitsAllocated)}}, + {DCM_IMGBITSSTORED, DCM_US, "", 1, sizeof(iBitsStored), + {reinterpret_cast(&iBitsStored)}}, + {DCM_IMGHIGHBIT, DCM_US, "", 1, sizeof(iHighBit), + {reinterpret_cast(&iHighBit)}}, + {DCM_IMGPIXELREPRESENTATION, DCM_US, "", 1, sizeof(iPixRep), + {reinterpret_cast(&iPixRep)}}, + {DCM_IMGSAMPLESPERPIXEL, DCM_US, "", 1, sizeof(iSamplesPerPixel), + {reinterpret_cast(&iSamplesPerPixel)}}, + {DCM_IMGRESCALESLOPE, DCM_DS, "", 1, strlen(szRescaleSlope), + {szRescaleSlope}}, + {DCM_IMGRESCALEINTERCEPT, DCM_DS, "", 1, strlen(szRescaleIntercept), + {szRescaleIntercept}}, + {DCM_IMGPHOTOMETRICINTERP, DCM_CS, "", 1, strlen(szImgPhotometricInterp), + {szImgPhotometricInterp}}, + {DCM_IMGPIXELSPACING, DCM_DS, "", 1, strlen(szPixelSpacing), + {szPixelSpacing}}, + {DCM_RELIMAGEORIENTATIONPATIENT, DCM_DS, "", 1, + strlen(szRelImageOrientationPatient), {szRelImageOrientationPatient}}, + {DCM_RELIMAGEPOSITIONPATIENT, DCM_DS, "", 1, + strlen(szRelImagePositionPatient), {szRelImagePositionPatient}}, + {DCM_ACQKVP, DCM_DS, "", 1, strlen(szAcqKvp), {szAcqKvp}}, + {DCM_RELACQUISITIONNUMBER, DCM_IS, "", 1, strlen(szRelAcquisitionNumber), + {szRelAcquisitionNumber}}, + {DCM_ACQSLICETHICKNESS, DCM_DS, "", 1, strlen(szRelAcquisitionNumber), + {szRelAcquisitionNumber}}, + {DCM_RELIMAGENUMBER, DCM_IS, "", 1, strlen(szRelImageNumber), + {szRelImageNumber}}, + {DCM_IDSOPINSTANCEUID, DCM_UI, "", 1, strlen(szIDSOPInstanceUID), + {szIDSOPInstanceUID}}, + {DCM_IDMANUFACTURER, DCM_LO, "", 1, strlen(szIDManufacturer), + {szIDManufacturer}}, + {DCM_RELPOSITIONREFINDICATOR, DCM_LO, "", 1, + strlen(szRelPositionRefIndicator), {szRelPositionRefIndicator}}, + {DCM_RELFRAMEOFREFERENCEUID, DCM_UI, "", 1, + strlen(szRelFrameOfReferenceUID), {szRelFrameOfReferenceUID}}, + {DCM_RELSERIESNUMBER, DCM_IS, "", 1, strlen(szRelSeriesNumber), + {szRelSeriesNumber}}, + {DCM_RELSERIESINSTANCEUID, DCM_UI, "", 1, strlen(szIDAccessionNumber), + {szIDAccessionNumber}}, + {DCM_IDACCESSIONNUMBER, DCM_SH, "", 1, strlen(szIDAccessionNumber), + {szIDAccessionNumber}}, + {DCM_RELSTUDYID, DCM_SH, "", 1, strlen(szRelStudyID), {szRelStudyID}}, + {DCM_IDREFERRINGPHYSICIAN, DCM_PN, "", 1, strlen(szIDReferringPhysician), + {szIDReferringPhysician}}, + {DCM_IDSTUDYTIME, DCM_TM, "", 1, strlen(szIDStudyTime), {szIDStudyTime}}, + {DCM_IDSTUDYDATE, DCM_DA, "", 1, strlen(szIDStudyDate), {szIDStudyDate}}, + {DCM_RELSTUDYINSTANCEUID, DCM_UI, "", 1, strlen(szRelStudyInstanceUID), + {szRelStudyInstanceUID}}, + {DCM_PATSEX, DCM_CS, "", 1, strlen(szPatSex), {szPatSex}}, + {DCM_PATBIRTHDATE, DCM_DA, "", 1, strlen(szPatBirthdate), {szPatBirthdate}}, + {DCM_PATID, DCM_LO, "", 1, strlen(szPatID), {szPatID}}, + {DCM_PATNAME, DCM_PN, "", 1, strlen(szPatName), {szPatName}}, + {DCM_IDIMAGETYPE, DCM_CS, "", 1, strlen(szIDImageType), {szIDImageType}}, + {DCM_IDMODALITY, DCM_CS, "", 1, strlen(szModality), {szModality}}, + {DCM_IDSOPCLASSUID, DCM_UI, "", 1, strlen(szSOPClassUID), {szSOPClassUID}}, + {DCM_IDMANUFACTURERMODEL, DCM_LO, "", 1, strlen(szIDManufacturerModel), + {szIDManufacturerModel}}, + {DCM_PATCOMMENTS, DCM_LT, "", 1, strlen(pszPatComments), {pszPatComments}}, }; int nElemRequired = sizeof (aElemRequired) / sizeof(DCM_ELEMENT); int iUpdateCount; cond = DCM_ModifyElements (&m_pObject, aElemRequired, nElemRequired, NULL, 0, &iUpdateCount); - DCM_ELEMENT elemPixelData = {DCM_PXLPIXELDATA, DCM_OT, "", 1, 0, NULL}; + DCM_ELEMENT elemPixelData = {DCM_PXLPIXELDATA, DCM_OT, "", 1, 0, {NULL}}; unsigned long lRealLength = 2 * m_pImageFile->nx() * m_pImageFile->ny(); diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index d10e1bd..4a49465 100644 --- a/libctsim/imagefile.cpp +++ b/libctsim/imagefile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: imagefile.cpp,v 1.45 2001/09/24 09:40:42 kevin Exp $ +** $Id: imagefile.cpp,v 1.46 2002/06/27 03:19:23 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -841,7 +841,7 @@ ImageFile::fftRows (ImageFile& result) const fftw_complex* in = new fftw_complex [m_nx]; std::complex* pcRow = new std::complex [m_nx]; - for (int iy = 0; iy < m_ny; iy++) { + for (unsigned int iy = 0; iy < m_ny; iy++) { unsigned int ix; for (ix = 0; ix < m_nx; ix++) { in[ix].re = vReal[ix][iy]; @@ -892,7 +892,7 @@ ImageFile::ifftRows (ImageFile& result) const std::complex* pcRow = new std::complex [m_nx]; unsigned int ix, iy; - unsigned int iArray = 0; + // unsigned int iArray = 0; for (iy = 0; iy < m_ny; iy++) { for (ix = 0; ix < m_nx; ix++) { double dImag = 0; @@ -943,7 +943,7 @@ ImageFile::fftCols (ImageFile& result) const std::complex* pcCol = new std::complex [m_ny]; fftw_complex* in = new fftw_complex [m_ny]; - for (int ix = 0; ix < m_nx; ix++) { + for (unsigned int ix = 0; ix < m_nx; ix++) { unsigned int iy; for (iy = 0; iy < m_ny; iy++) { in[iy].re = vReal[ix][iy]; @@ -994,7 +994,7 @@ ImageFile::ifftCols (ImageFile& result) const std::complex* pcCol = new std::complex [m_ny]; unsigned int ix, iy; - unsigned int iArray = 0; + // unsigned int iArray = 0; for (ix = 0; ix < m_nx; ix++) { for (iy = 0; iy < m_ny; iy++) { double dImag = 0; @@ -1609,22 +1609,24 @@ ImageFile::readImagePNG (const char* const pszFile) ImageFileArray v = getArray(); for (int iy = 0; iy < height; iy++) { for (int ix = 0; ix < width; ix++) { - double dV; + double dV = 0; if (color_type == PNG_COLOR_TYPE_GRAY) { if (bit_depth == 8) dV = row_pointers[iy][ix] / 255.; else if (bit_depth == 16) { int iBase = ix * 2; dV = (row_pointers[iy][iBase] + (row_pointers[iy][iBase+1] << 8)) / 65536.; - } + } else + dV = 0; } else if (color_type == PNG_COLOR_TYPE_RGB) { if (bit_depth == 8) { int iBase = ix * 3; double dR = row_pointers[iy][iBase] / 255.; double dG = row_pointers[iy][iBase+1] / 255.; double dB = row_pointers[iy][iBase+2] / 255.; - dV = colorToGrayscale (dR, dG, dR); - } + dV = colorToGrayscale (dR, dG, dB); + } else + dV = 0; } v[ix][height-iy-1] = dV; } diff --git a/libctsim/projections.cpp b/libctsim/projections.cpp index 9533d7f..612ab6b 100644 --- a/libctsim/projections.cpp +++ b/libctsim/projections.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: projections.cpp,v 1.79 2002/06/27 01:48:26 kevin Exp $ +** $Id: projections.cpp,v 1.80 2002/06/27 03:19:23 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -975,7 +975,7 @@ Projections::convertPolar (ImageFile& rIF, int iInterpolationID) for (iView = 0; iView < pProj->m_nView; iView++) { ppcDetValue[iView] = new std::complex [pProj->m_nDet]; DetectorValue* detval = pProj->getDetectorArray (iView).detValues(); - for (unsigned int iDet = 0; iDet < pProj->m_nDet; iDet++) + for (int iDet = 0; iDet < pProj->m_nDet; iDet++) ppcDetValue[iView][iDet] = std::complex(detval[iDet], 0); } @@ -1140,7 +1140,7 @@ Projections::interpolatePolar (ImageFileArray& v, ImageFileArray& vImag, { typedef std::complex complexValue; - BilinearInterpolator* pBilinear; + BilinearInterpolator* pBilinear = NULL; if (iInterpolationID == POLAR_INTERP_BILINEAR) pBilinear = new BilinearInterpolator (ppcDetValue, nView, nDetWithZeros); @@ -1338,8 +1338,8 @@ Projections::interpolateToParallel () const /////////////////////////////////////////////////////////////////////////////// ParallelRaysums::ParallelRaysums (const Projections* pProjections, int iThetaRange) -: m_iNumCoordinates(0), m_iNumView(pProjections->nView()), m_iNumDet(pProjections->nDet()), - m_iThetaRange (iThetaRange), m_pCoordinates(NULL) +: m_pCoordinates(NULL), m_iNumCoordinates(0), m_iNumView(pProjections->nView()), m_iNumDet(pProjections->nDet()), + m_iThetaRange (iThetaRange) { int iGeometry = pProjections->geometry(); double dDetInc = pProjections->detInc(); diff --git a/src/ctsim.cpp b/src/ctsim.cpp index eea9e60..6f6d6b1 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: ctsim.cpp,v 1.118 2002/06/20 11:55:44 kevin Exp $ +** $Id: ctsim.cpp,v 1.119 2002/06/27 03:19:23 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -69,7 +69,7 @@ #endif #endif -static const char* rcsindent = "$Id: ctsim.cpp,v 1.118 2002/06/20 11:55:44 kevin Exp $"; +static const char* rcsindent = "$Id: ctsim.cpp,v 1.119 2002/06/27 03:19:23 kevin Exp $"; struct option CTSimApp::ctsimOptions[] = { @@ -1019,11 +1019,8 @@ MainFrame::OnImport (wxCommandEvent& WXUNUSED(event) ) void MainFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) { - long lFreeMem = ::wxGetFreeMemory() / (1024L * 1024L); wxString strOSDesc = ::wxGetOsDescription(); *theApp->getLog() << "Operating System: " << strOSDesc; - if (lFreeMem > 0) - *theApp->getLog() << ", Free Memory: " << lFreeMem << " MB"; *theApp->getLog() << ", wxWindows: " << wxVERSION_STRING; #ifdef __TIMESTAMP__ *theApp->getLog() << ", Build Date: " << __TIMESTAMP__; @@ -1034,9 +1031,9 @@ MainFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) *theApp->getLog() << ", Release version"; #endif #ifdef VERSION - *theApp->getLog() << " " << VERSION; -#elif defined(CTSIMVERSION) - *theApp->getLog() << " " << CTSIMVERSION; + *theApp->getLog() << " " << VERSION; +#elif defined(CTSIMVERSION) + *theApp->getLog() << " " << CTSIMVERSION; #endif *theApp->getLog() << "\n"; diff --git a/src/ctsim.xpm b/src/ctsim.xpm index 91dad21..34f5e90 100644 --- a/src/ctsim.xpm +++ b/src/ctsim.xpm @@ -151,296 +151,3 @@ static char *ctsim16_xpm[] = { ".-.-.- j., + G z.+ g 1 u o.-.-.-" }; - -/* XPM */ -static char *ctsim32_xpm[] = { -/* width height ncolors chars_per_pixel */ -"32 32 253 2", -/* colors */ -" c #D8D800", -" . c #F3F300", -" X c #D3D330", -" o c #F3E900", -" O c #F5EAF7", -" + c #F7EFEF", -" @ c #FFFFA4", -" # c #DFDFD4", -" $ c #D8D817", -" % c #FFFFFA", -" & c #FAFAFF", -" * c #FAFC00", -" = c #DFDF00", -" - c #FAFA00", -" ; c #FCF7F7", -" : c #F8F0FD", -" > c #FAF5F5", -" , c #FFFFE6", -" < c #DFD300", -" 1 c #F0F100", -" 2 c #FFFFA7", -" 3 c #E6E600", -" 4 c #FDFBFB", -" 5 c #E8E8ED", -" 6 c #D5D577", -" 7 c #FBF9F9", -" 8 c #FFFFE9", -" 9 c #F7F3F5", -" 0 c #F7EC00", -" q c #EDED00", -" w c #D4D42D", -" e c #FFFF96", -" r c #F4E8E8", -" t c #FEFD00", -" y c #FEFB00", -" u c #FFFFEC", -" i c #F7EEEE", -" p c #F5ECEC", -" a c #FBF874", -" s c #CFC400", -" d c #D3D350", -" f c #FBFBFF", -" g c #FFFF2F", -" h c #DDDD07", -" j c #C5C500", -" k c #E0E000", -" l c #FBFB00", -" z c #FFFF5A", -" x c #FBF700", -" c c #FAF4F4", -" v c #F1F200", -" b c #FFFFDB", -" n c #FFFF07", -" m c #E7E700", -" M c #FDFAFA", -" N c #F8F900", -" B c #DDD200", -" V c #F8ED00", -" C c #FFFF49", -" Z c #D3D300", -" A c #EEEE00", -" S c #F5ECF2", -" D c #FEFEFE", -" F c #FFFFCA", -" G c #C6C667", -" H c #F4E7E7", -" J c #FFFC00", -" K c #FFFF60", -" L c #FFFF8B", -" P c #FFFF21", -" I c #DADA00", -" U c #F5F500", -" Y c #FFFE81", -" T c #FFFFE1", -" R c #F5E900", -" E c #FFFF0D", -" W c #F7EDED", -" Q c #F5EBEB", -" ! c #FCF83F", -" ~ c #D0C500", -" ^ c #FCFAFF", -" / c #E1E100", -" ( c #FCFC00", -" ) c #FEFC2D", -" _ c #FCF800", -" ` c #D6D573", -" ' c #F7F2FA", -" ] c #F8F1F1", -" [ c #F6EFEF", -" { c #F2E700", -" } c #F2E500", -" | c #FDFCD8", -". c #E8EA00", -".. c #FFFF3B", -".X c #E8E800", -".o c #FFFFFB", -".O c #DBDBA6", -".+ c #DEDF00", -".@ c #F9FA00", -".# c #FBF7F7", -".$ c #FFFF52", -".% c #D4D400", -".& c #FFFF13", -".* c #FFFFA8", -".= c #FDFB7B", -".- c #D7D724", -".; c #FFFFFE", -".: c #E5E600", -".> c #FEFDFD", -"., c #E4DE69", -".< c #FCFBFB", -".1 c #FEFDBE", -".2 c #DBDB00", -".3 c #F6F600", -".4 c #ECE8DE", -".5 c #F9F5F8", -".6 c #F6EA00", -".7 c #D1D200", -".8 c #F5EAEA", -".9 c #FFFF97", -".0 c #E2E400", -".q c #E2E200", -".w c #FDFD00", -".e c #FDFB00", -".r c #FDF900", -".t c #FFFFAE", -".y c #F8F0F0", -".u c #FFFFD9", -".i c #F3E800", -".p c #F6EEEE", -".a c #CECE00", -".s c #E9E900", -".d c #FFFF05", -".f c #D4D41D", -".g c #FFFFF0", -".h c #FAF700", -".j c #FBF6F6", -".k c #FFFF1C", -".l c #F9F4F4", -".z c #F0F200", -".x c #D5D500", -".c c #D7D72D", -".v c #E4E408", -".b c #CBCB35", -".n c #FEFCFC", -".m c #D9D971", -".M c #CBC000", -".N c #FCFAFA", -".B c #C1C100", -".V c #DCDC00", -".C c #F7F700", -".Z c #D7D7C5", -".A c #F7EB00", -".S c #E2E2DD", -".D c #D2C700", -".F c #FEFEFF", -".G c #E3E300", -".H c #FEFE00", -".J c #F3E7E7", -".K c #FFFFF6", -".L c #FEFC00", -".P c #D9DA00", -".I c #D0D036", -".U c #F4E900", -".Y c #FFFF0E", -".T c #EAEA00", -".R c #F6EDED", -".E c #D7D74A", -".W c #FFFFF9", -".Q c #E0E100", -".! c #D9D90D", -".~ c #FBF800", -".^ c #D4D4A7", -"./ c #BBBB00", -".( c #F9F3F3", -".) c #F1F100", -"._ c #D6D62B", -".` c #F1E500", -".' c #EEEEF2", -".] c #D7D722", -".[ c #F1E300", -".{ c #FFFFD1", -".} c #FFFFFC", -".| c #CCC100", -"X c #F8F8FF", -"X. c #FCF9F9", -"XX c #A7A700", -"Xo c #DDDD00", -"XO c #F8F800", -"X+ c #FAF7F7", -"X@ c #EEEF00", -"X# c #FFFF14", -"X$ c #E4E4D4", -"X% c #FFFF3F", -"X& c #FFFFD4", -"X* c #D3C800", -"X= c #EEE300", -"X- c #FFFFFF", -"X; c #FEFFFE", -"X: c #F5E8E8", -"X> c #FFFF00", -"X, c #FFFF95", -"X< c #FFFD00", -"X1 c #FFFB00", -"X2 c #F3E6E6", -"X3 c #DADB00", -"X4 c #FFFF81", -"X5 c #F5EA00", -"X6 c #EBEB00", -"X7 c #F6ECEC", -"X8 c #F4EAEA", -"X9 c #FCF9FF", -"X0 c #FCFD00", -"Xq c #FCF900", -"Xw c #FFFF84", -"Xe c #F2F400", -"Xr c #F9F2F2", -"Xt c #FCF821", -"Xy c #D3D366", -"Xu c #FFFFDA", -"Xi c #F7F0F0", -"Xp c #F7EEF0", -"Xa c #FFFF70", -"Xs c #FFFF06", -"Xd c #FCF80D", -"Xf c #DEDE00", -"Xg c #FCF8F8", -"Xh c #FAF6F6", -"Xj c #FFFFB2", -"Xk c #D4D500", -"Xl c #FFFF48", -"Xz c #FFFF09", -"Xx c #DFDF0E", -"Xc c #DEDED7", -"Xv c #CACA00", -"Xb c #FFFEFE", -"Xn c #E5E500", -"Xm c #FDFCFC", -"XM c #FFFF5F", -"XN c #F9F798", -"XB c #DBDC00", -"XV c #F6F700", -"XC c #FFFFB5", -"XZ c #FFFFE0", -"XA c #F6EB00", -"XS c #F6E900", -"XD c #ECEE00", -"XF c #D1D100", -"XG c #F6EBEB", -"XH c #FFFF37", -"XJ c #F4E9E9", -"XK c #FFFF8D", -"XL c #ECE681", -/* pixels */ -"X-X-X-X-X-X-X-X-X-X-.#.R Q.JX2X2.JX2.J.8X7XhXbX-X-X-X-X-X-X-X-X-", -"X-X-X-X-X-X-X-X-.(XJ r.j.NX-X-X-X-X-X-.N.#XJXJ.(X-X-X-X-X-X-X-X-", -"X-X-X-X-X-X- M.8.R MX-X-X-X-X-X-X-X-X-X-X-X- 4 +.8XgX-X-X-X-X-X-", -"X-X-X-X-X; 9 OX9X-X-X-X-X-X-X-X-X-X-X-X-X-X-X-X-.NXG.lX-X-X-X-X-", -"X-X-X-X- 'XL YXuX-X-X-X-X-X-X-X-X-X-X-X-X-X-X-X-X-Xb.y.(X-X-X-X-", -"X-X-X-X+ :.9X> E CX, TX-X-X-X-X-X-X-X-X-X-X-X-X-X-X-X- ] >X-X-X-", -"X-X- M Q.F b nX>X>X>X#.$ @ uX-X-X-X-X-X-X-X-X-X-X-X-X-Xb pX.X-X-", -"X-Xb p.NX-.o gX>X>X>X>X>X>.kXM.* 8X-X-X-X-X-X-X-X-X-X-X- 4.8.>X-", -"X- > [X-X-X- KX>X>X>X>X>X>X>X>X>.k KXj.gX-X-X-X-X-X-X-X-X-Xi.(X-", -" D pXmX-X-X- eX>X>X> t.~ _Xq yX", -" ;X8X-X-X-X-.{.dX>.L { o.U.i < ~ s B { R o } )X4 F.}X-X-X-X-.pXh", -" + 7X-X-X-X-.W PX> _.UX>X>.+.P 1 vXBX3X>X>.U _X>.d.. LX&.;X- ^Xp", -" i.NX-X-X-X-X- zX> _.UX> =.qX>Xn.G.wXn.2X>.U _X>X>X>X>XzX% L |Xp", -"X:XbX-X-X-X-X-XKX> _ R *.x.)XF UXO.G.H.%.@XS _X>X>X>X>X>X>X>.Y.,", -" HX-X-X-X-X-X-.1X> _XAXeXo q k q j A 3XD.A _X>X>X>X>X>X>X>X>._", -" HX-X-X-X-X-X- u.& _ 0. .sX6 -.B./X6X6 ..Q V _X>X>X>X>X>X>X>X>.-", -" HX-X-X-X-X-X-X-Xl _ 0. .T q lXo.a m.3 UX3 V _X>X>X>X>X>X>X>X>.]", -" HX-X-X-X-X-X-X-Xw _.A.zXf.w 3Xn k /X>./.0 V _X>X>X>X>X>X>X>X>.c", -" HX-X-X-X-X-X-X-XC _X5 N ZX>.).XX>.HXOXXXV.6 _X>X>X>X>X>X>X>X>.E", -" W. I mX>.V =X>XfXvX>.U _X>X>X>X>X>X>X> l.m", -" iX.X-X-X-X-X-X-.; !.UX>X0Xk.:X@.z. .7 *X>.U _X>X>X>X>X>X>X> U.O", -".# QX-X-X-X-X-X-X-.= } oX5.`X*.|.M.DX=X5 o.[.eX>X>X>X>X>X>X>Xx 5", -"Xb QXmX-X-X-X-X-X-.t.L.~ _.r J x.h J.r _.~.eX>X>X>X>X>X>X>.wXy &", -"X- cXiX-X-X-X-X-X-XZXzX>X>X>X>X>X>X>X>X>X>X>X>X>X>X>X>X>X>.vX$X-", -"X-Xb Q.NX-X-X-X-X-.}XHX>X>X>X>X>X>X>X>X>X>X>X>X>X>X>X>X>.C 6 fX-", -"X-X-X. pXbX-X-X-X-X-XaX>X>X>X>X>X>X>X>X>X>X>X>X>X>X>X>X>.I.'X-X-", -"X-X-X- > ]X-X-X-X-X- 2X>X>X>X>X>X>X>X>X>X>X>X>X>X>X>X> $ #X-X-X-", -"X-X-X-X-.(.yXbX-X-X-.uXsX>X>X>X>X>X>X>X>X>X>X>X>X>.w.f.ZX-X-X-X-", -"X-X-X-X-X-.lXG 4X-X- % gX>X>X>X>X>X>X>X>X>X>X>X>.3.bXcX-X-X-X-X-", -"X-X-X-X-X-X-Xg.8 i.nX-XaX>X>X>X>X>X>X>X>X>X> ( h G 5X-X-X-X-X-X-", -"X-X-X-X-X-X-X- DXrXJ SXN (X>X>X>X>X>X> -.).! G.Z &X-X-X-X-X-X-X-", -"X-X-X-X-X-X-X-X-X- D.5.4 ` d w.-.- X d 6.^.SX X-X-X-X-X-X-X-X-X-" -}; diff --git a/src/graph3dview.cpp b/src/graph3dview.cpp index a3343ab..7d08275 100644 --- a/src/graph3dview.cpp +++ b/src/graph3dview.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: graph3dview.cpp,v 1.28 2002/06/03 16:57:22 kevin Exp $ +** $Id: graph3dview.cpp,v 1.29 2002/06/27 03:19:23 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -286,7 +286,7 @@ Graph3dFileView::CreateDisplayList() p3[0] = dXPos; p3[1] = actScale * (v[ix][1] + actOffset); p3[2] = dYPos + 1; CalculateVectorNormal (p1, p2, p3, &n1[0], &n1[1], &n1[2]); - double dIntensity1, dIntensity2; + double dIntensity1 = 0., dIntensity2 = 0.; if (m_bColor) { dIntensity1 = (v[ix][0] - dMin) / dIntensityScale; dIntensity2 = (v[ix+1][0] - dMin) / dIntensityScale; @@ -296,12 +296,13 @@ Graph3dFileView::CreateDisplayList() intensityToColor (dIntensity1, vecColor); glColor3fv (vecColor); } - glVertex3dv (p1); - glNormal3dv (n1); + glVertex3dv (p1); glNormal3dv (n1); + if (m_bColor) { intensityToColor (dIntensity2, vecColor); glColor3fv (vecColor); - glVertex3dv (p2); - glNormal3dv (n1); + } + glVertex3dv (p2); glNormal3dv (n1); + double lastP[3]; lastP[0] = ix; lastP[1] = actScale * (v[ix][0] + actOffset); lastP[2] = 0; for (unsigned int iy = 1; iy < ny - 1; iy++, dYPos++) { @@ -309,14 +310,18 @@ Graph3dFileView::CreateDisplayList() p2[0] = dXPos+1; p2[1] = actScale * (v[ix+1][iy] + actOffset); p2[2] = dYPos; CalculateVectorNormal (p1, p2, lastP, &n1[0], &n1[1], &n1[2]); lastP[0] = p1[0]; lastP[1] = p1[1]; lastP[2] = p1[2]; - dIntensity1 = (v[ix][iy] - dMin) / dIntensityScale; - dIntensity2 = (v[ix+1][iy] - dMin) / dIntensityScale; - intensityToColor (dIntensity1, vecColor); - glColor3fv (vecColor); - glVertex3dv (p1); glNormal3dv (n1); - intensityToColor (dIntensity2, vecColor); - glColor3fv (vecColor); - glVertex3dv (p2); glNormal3dv (n1); + if (m_bColor) { + dIntensity1 = (v[ix][iy] - dMin) / dIntensityScale; + dIntensity2 = (v[ix+1][iy] - dMin) / dIntensityScale; + intensityToColor (dIntensity1, vecColor); + glColor3fv (vecColor); + } + glVertex3dv (p1); glNormal3dv (n1); + if (m_bColor) { + intensityToColor (dIntensity2, vecColor); + glColor3fv (vecColor); + } + glVertex3dv (p2); glNormal3dv (n1); } glEnd(); // QUAD_STRIP } @@ -682,7 +687,7 @@ Graph3dFileView::OnScaleSet (wxCommandEvent& event) unsigned int nx = GetDocument()->nx(); unsigned int ny = GetDocument()->ny(); const ImageFileArrayConst v = GetDocument()->getArray(); - double dMin, dMax; + double dMin = 0., dMax = 0.; if (! m_bColorScaleMinSet && ! m_bColorScaleMaxSet) { dMax = dMin = v[0][0]; for (unsigned ix = 0; ix < nx; ix++) -- 2.34.1