r605: *** empty log message ***
[ctsim.git] / libctsim / ctndicom.cpp
index 72d32181ad0209001db6f7c843a06b4e70501850..5762032eda1c09bb781e58a973efc5d441bd05bc 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: ctndicom.cpp,v 1.3 2001/03/02 02:08:14 kevin Exp $
+**  $Id: ctndicom.cpp,v 1.5 2001/03/05 15:10:58 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
@@ -177,7 +177,7 @@ DicomImporter::loadProjections()
   }
 
   DCM_TAG somatomTag = DCM_MAKETAG(TAG_GROUP_SOMATOM, TAG_MEMBER_SOMATOM_DATA);
-  DCM_ELEMENT elemProjections = {somatomTag, DCM_OT, "", 1, 0, NULL};
+  DCM_ELEMENT elemProjections = {somatomTag, DCM_UNKNOWN, "", 1, 0, NULL};
   if (DCM_GetElementSize (&m_pFile, elemProjections.tag, &lRtnLength) != DCM_NORMAL) {
     m_bFail = true;
     m_strFailMessage = "Can't find projection data";
@@ -198,7 +198,13 @@ DicomImporter::loadProjections()
   }
   m_iContents = DICOM_CONTENTS_PROJECTIONS;
   m_pProjections = new Projections;
-  m_pProjections->initFromSomatomAR_STAR (iNViews, iNDets, pRawProjections, lRtnLength);  
+  if (! m_pProjections->initFromSomatomAR_STAR (iNViews, iNDets, pRawProjections, lRtnLength)) {
+    m_bFail = true;
+    m_strFailMessage = "Error converting raw projection data";
+    delete m_pProjections;
+    m_pProjections = NULL;
+  }
+
   delete pRawProjections;
 }