/*============================================================================ MetaIO Copyright 2000-2010 Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ #include "metaEllipse.h" #ifdef _MSC_VER #pragma warning(disable:4702) #endif #include #include #include #include // for memset #if defined (__BORLANDC__) && (__BORLANDC__ >= 0x0580) #include #endif #if (METAIO_USE_NAMESPACE) namespace METAIO_NAMESPACE { #endif // // MedImage Constructors // MetaEllipse:: MetaEllipse() :MetaObject() { if(META_DEBUG) METAIO_STREAM::cout << "MetaEllipse()" << METAIO_STREAM::endl; Clear(); } // MetaEllipse:: MetaEllipse(const char *_headerName) :MetaObject() { if(META_DEBUG) METAIO_STREAM::cout << "MetaEllipse()" << METAIO_STREAM::endl; Clear(); Read(_headerName); } // MetaEllipse:: MetaEllipse(const MetaEllipse *_ellipse) :MetaObject() { if(META_DEBUG) METAIO_STREAM::cout << "MetaEllipse()" << METAIO_STREAM::endl; Clear(); CopyInfo(_ellipse); } MetaEllipse:: MetaEllipse(unsigned int dim) :MetaObject(dim) { if(META_DEBUG) METAIO_STREAM::cout << "MetaEllipse()" << METAIO_STREAM::endl; Clear(); } // MetaEllipse:: ~MetaEllipse() { M_Destroy(); } // void MetaEllipse:: PrintInfo() const { MetaObject::PrintInfo(); METAIO_STREAM::cout << "Radius = "; for(int i=0;iterminateRead = true; m_Fields.push_back(mF); } void MetaEllipse:: M_SetupWriteFields(void) { strcpy(m_ObjectTypeName,"Ellipse"); MetaObject::M_SetupWriteFields(); MET_FieldRecordType * mF; mF = new MET_FieldRecordType; MET_InitWriteField(mF, "Radius", MET_FLOAT_ARRAY, m_NDims,m_Radius); m_Fields.push_back(mF); } bool MetaEllipse:: M_Read(void) { if(META_DEBUG) METAIO_STREAM::cout << "MetaEllipse: M_Read: Loading Header" << METAIO_STREAM::endl; if(!MetaObject::M_Read()) { METAIO_STREAM::cout << "MetaEllipse: M_Read: Error parsing file" << METAIO_STREAM::endl; return false; } if(META_DEBUG) METAIO_STREAM::cout << "MetaEllipse: M_Read: Parsing Header" << METAIO_STREAM::endl; MET_FieldRecordType * mF; mF = MET_GetFieldRecord("Radius", &m_Fields); if(mF->defined) { for(int i=0;ivalue[i]; } } return true; } #if (METAIO_USE_NAMESPACE) }; #endif