From 96ca5a0d7b7ccd6b4291160c19afd48e3207db2a Mon Sep 17 00:00:00 2001 From: Frederic Cervenansky Date: Thu, 25 Jun 2009 15:20:52 +0000 Subject: [PATCH] Clean-Up with Juan Sebastien --- src2/CMakeLists.txt | 2 +- src2/creaImageIOAbstractImageReader.h | 11 + src2/creaImageIODicomImageReader.cpp | 19 +- src2/creaImageIODicomImageReader.h | 6 +- src2/creaImageIOGimmick.h | 2 +- src2/creaImageIOGimmickView.h | 144 +----- src2/creaImageIOImageReader.cpp | 34 +- src2/creaImageIOImageReader.h | 1 + src2/creaImageIOListener.h | 2 +- src2/creaImageIOMultiThreadImageReader.cpp | 18 +- src2/creaImageIOSQLiteTreeHandler.cpp | 461 +------------------- src2/creaImageIOSQLiteTreeHandler.h | 58 +-- src2/creaImageIOTreeAttributeDescriptor.cpp | 4 - src2/creaImageIOTreeAttributeDescriptor.h | 3 + src2/creaImageIOTreeDescriptor.cpp | 1 + src2/creaImageIOTreeHandlerImageAdder.cpp | 2 +- src2/creaImageIOTreeNode.h | 35 +- src2/creaImageIOUltrasonixImageReader.cpp | 4 - src2/creaImageIOUltrasonixImageReader.h | 6 +- src2/creaImageIOVtkImageReader.cpp | 17 +- src2/creaImageIOVtkImageReader.h | 4 + src2/creaImageIOWxViewer.cpp | 12 +- 22 files changed, 86 insertions(+), 760 deletions(-) diff --git a/src2/CMakeLists.txt b/src2/CMakeLists.txt index 6f3924e..9aded62 100644 --- a/src2/CMakeLists.txt +++ b/src2/CMakeLists.txt @@ -14,7 +14,7 @@ SET( SRCS creaImageIOTreeDescriptor creaImageIOTreeLevelDescriptor creaImageIOTreeAttributeDescriptor - creaImageIOTreeComparators + # Image readers creaImageIOAbstractImageReader diff --git a/src2/creaImageIOAbstractImageReader.h b/src2/creaImageIOAbstractImageReader.h index c1c15ef..e732620 100644 --- a/src2/creaImageIOAbstractImageReader.h +++ b/src2/creaImageIOAbstractImageReader.h @@ -24,14 +24,25 @@ namespace creaImageIO AbstractImageReader() {} virtual ~AbstractImageReader() {} + /// Get the reader's name const std::string& GetName() const { return mName; } + + /// Add file extensions read by the reader virtual void PushBackExtensions(std::vector&) {} + + /// Test if file is read by this reader virtual bool CanRead(const std::string& filename) { return false; } + + /// return for a file a 2D VTkImage virtual vtkImageData* ReadImage(const std::string& filename) { return 0; } + + /// Read the attributes for a file virtual void ReadAttributes(const std::string& filename, tree::AttributeMapType& attr) {} protected: + + /// Set the reader's name void SetName(const std::string& s) { mName = s; } private: std::string mName; diff --git a/src2/creaImageIODicomImageReader.cpp b/src2/creaImageIODicomImageReader.cpp index b51bff2..35075fb 100644 --- a/src2/creaImageIODicomImageReader.cpp +++ b/src2/creaImageIODicomImageReader.cpp @@ -28,16 +28,6 @@ namespace creaImageIO //===================================================================== bool DicomImageReader::CanRead(const std::string& filename) { - // std::cout << "## Reader "<& attr) { - // std::cout << "DicomImageReader::ReadDicomInfo '"<first,gr,el); - // GimmickMessage(2,"Key '"<first<<"' : "<GetEntryString(gr,el); i->second = irclean(val); - // GimmickMessage(2,"Key '"<first<<"' : "<::const_iterator i; - for (i=GetKnownExtensions().begin(); - i!=GetKnownExtensions().end(); - i++) - { - std::cout << "'"<<(*i)<<"'"<::iterator i; + std::vector::iterator i; for (i=mReader.begin(); i!=mReader.end(); i++) { - // std::cout << "#### ImageReader::UnRegister(" - // << (*i)->GetName()<<")"<GetName()<<")"<PushBackExtensions(mKnownExtensions); + } //===================================================================== //===================================================================== // Returns true iff the file is readable bool ImageReader::CanRead( const std::string& filename ) - // const std::string& exclude ) { - // std::cout << "## ImageReader::CanRead("<::iterator i; for (i=mReader.begin(); i!=mReader.end(); i++) { - // if ((*i)->GetName()==exclude) continue; ok = (*i)->CanRead(filename); if (ok) { @@ -133,29 +116,22 @@ namespace creaImageIO //===================================================================== // Reads the file (CanRead must be called before : no test here) vtkImageData* ImageReader::ReadImage( const std::string& filename) - // const std::string& exclude ) { - // std::cout << "## ImageReader::Read("<ShallowCopy(mUnreadableImage); return im; } } vtkImageData* i = mLastReader->ReadImage(mLastFilename); - // std::cout << "i="<ShallowCopy(mUnreadableImage); } - // std::cout << "i="<GetScalarTypeAsString()<<", pointer="<& attr) { - // std::cout << "ImageReader::ReadDicomInfo '"< mReader; diff --git a/src2/creaImageIOListener.h b/src2/creaImageIOListener.h index 0405351..fe65ed8 100644 --- a/src2/creaImageIOListener.h +++ b/src2/creaImageIOListener.h @@ -4,7 +4,7 @@ #include #include #include - +#include // Signal/slot mechanism #include #include diff --git a/src2/creaImageIOMultiThreadImageReader.cpp b/src2/creaImageIOMultiThreadImageReader.cpp index 9e4db3c..3f4ba3a 100644 --- a/src2/creaImageIOMultiThreadImageReader.cpp +++ b/src2/creaImageIOMultiThreadImageReader.cpp @@ -13,6 +13,7 @@ namespace creaImageIO vtkImageData* image) { wxMutexLocker lock(mMultiThreadImageReaderUserMutex); + this->OnMultiThreadImageReaderEvent(filename,type,image); } //===================================================================== @@ -54,6 +55,8 @@ namespace creaImageIO { ThreadedImageReader* t = new ThreadedImageReader(this); mThreadedImageReaderList.push_back(t); + std::cout << " ===> Thread "< Thread "<<(*i)->GetCurrentId() - // <<" successfully created"<< std::endl; + std::cout << " ===> Thread "<<(*i)->GetCurrentId() + <<" successfully created"<< std::endl; } } @@ -114,7 +117,8 @@ namespace creaImageIO for (i =mThreadedImageReaderList.begin(); i!=mThreadedImageReaderList.end(); i++) - { + { std::cout << " ===> Thread "<<(*i)->GetCurrentId() + <<" successfully stopped"<< std::endl; if((*i)->IsAlive()) { (*i)->Delete(); @@ -130,7 +134,7 @@ namespace creaImageIO do { // Sleep a little - wxMilliSleep(10); + wxMilliSleep(10); // Lock { wxMutexLocker locker(GetMultiThreadImageReaderUserMutex()); @@ -279,7 +283,8 @@ namespace creaImageIO } else if (e==MultiThreadImageReaderUser::ThreadedReaderStopped) { - mNumberOfThreadedReadersRunning--; + + mNumberOfThreadedReadersRunning--; // std::cout << "#TR=" << mNumberOfThreadedReadersRunning << std::endl; } } @@ -545,8 +550,7 @@ namespace creaImageIO // While was not deleted while (!TestDestroy()) { - // std::cout << "### Thread "<MultiThreadImageReaderEventLock(); diff --git a/src2/creaImageIOSQLiteTreeHandler.cpp b/src2/creaImageIOSQLiteTreeHandler.cpp index 3d3fe70..f29a8ce 100644 --- a/src2/creaImageIOSQLiteTreeHandler.cpp +++ b/src2/creaImageIOSQLiteTreeHandler.cpp @@ -45,29 +45,6 @@ namespace creaImageIO //============================================================= - //============================================================= - // void SQLiteTreeHandler::Print() const - // { - /* - std::cout << "-> '"<Print(); - } - */ - // } - //============================================================= - - //===================================================================== - /* - bool SQLiteTreeHandler::LocationIsValid() - { - // TO DO - return true; - } - */ //===================================================================== @@ -222,11 +199,7 @@ namespace creaImageIO } //===================================================================== - // sqlite3_exec(db, zSQL, 0, 0, 0); - // sqlite3_free(zSQL); - // char* CHAIN = format_sql(QUER); \ -// sqlite3_free(CHAIN); \ - + //===================================================================== #define QUERYDB(QUER,RES) \ try \ @@ -447,7 +420,7 @@ namespace creaImageIO //===================================================================== bool SQLiteTreeHandler::DBImportTreeDescription() { - GimmickMessage(1,"Importing tree description from database ..." + GimmickMessage(1,"Importing tree description for database ..." <GetKey()); - if ( i != attr.end() ) - { - v = i->second; - } - */ + GetTree().UnsafeSetAttribute( a->GetKey(), "" ); } @@ -573,22 +539,6 @@ namespace creaImageIO } //===================================================================== - - - - - - - - - - - - - - - - //======================================================================== /// std::string& SQLformat(std::string& str) @@ -626,7 +576,7 @@ namespace creaImageIO { continue; } - // std::cout << "("<first<<","<second<<")"<first + "'"; values += "'" + SQLformat(i->second) + "'"; atts += ","; @@ -670,7 +620,6 @@ namespace creaImageIO } //===================================================================== - //===================================================================== int SQLiteTreeHandler::DBLoadChildren(tree::Node* node, int numberoflevels) @@ -710,7 +659,7 @@ namespace creaImageIO query += GetTree().GetLevelDescriptor(level+1).GetName(); if (level>0) { - query += " WHERE PARENT_ID='" + node->UnsafeGetAttribute("ID") + query += " WHERE PARENT_ID='" + node->GetAttribute("ID") + "'"; } CppSQLite3Query q; @@ -728,13 +677,7 @@ namespace creaImageIO { n->UnsafeSetAttribute(q.fieldName(fld),q.getStringField(fld)); } - /* - // Index - TypeId ti; - ti.type = type; - ti.id = n->GetFieldValue("ID"); - mTypeIdToNodeMap[ti] = n; - */ + // recurse if ( numberoflevels != 1 ) { @@ -807,39 +750,10 @@ namespace creaImageIO // Insert in DB DBInsert(child); - /* - std::string val; - SQLAppendAttributesValues(child,val); - std::string insert("INSERT INTO "); - insert += GetTree().GetLevelDescriptor(child->GetLevel()).GetName(); - insert += " " + val + ";"; - UPDATEDB(insert); - // Store DB id of newly created node; - long lastrow = mDB->lastRowId(); - std::stringstream ri; - ri << mDB->lastRowId(); - child->SetAttribute("ID",ri.str()); - */ // Down one level parent = child; - - /* - // Insert in TypeId map - TypeId ti; - ti.type = node->GetType(); - ti.id = node_id; - mTypeIdToNodeMap[ti] = node; - // std::cout << "== Insert TypeId ("<GetType()==Node::Patient) summary.added_patients++; - if (node->GetType()==Node::Study) summary.added_studies++; - if (node->GetType()==Node::Series) summary.added_series++; - if (node->GetType()==Node::Image) summary.added_images++; - */ - } + } } //====================================================================== @@ -1019,7 +933,7 @@ namespace creaImageIO query += GetTree().GetLevelDescriptor(level).GetName(); if (level>0) { - query += " WHERE ID='" + n->UnsafeGetAttribute("ID") + query += " WHERE ID='" + n->GetAttribute("ID") + "'"; } CppSQLite3Query q; @@ -1104,363 +1018,4 @@ namespace creaImageIO UPDATEDB(out.str()); } - /* - //===================================================================== - bool SQLiteTreeHandler::DBInsert(Node* alien_node, - UpdateSummary& summary) - { - // std::cout << "SQLiteTreeHandler::Insert('"<GetLabel() - // <<"')"<GetLabel()<<"'" - // << std::endl; - // Load the patients if not already done - DBLoadChildren(this,Node::Patient); - - parent_id = ""; - Node* parent = this; - - // The chain of ancestors - std::deque chain; - Node* cur = alien_node->GetParent(); - for (int type=Node::Patient; - typeGetType();++type) - { - chain.push_front(cur); - cur = cur->GetParent(); - } - - // create the nodes if do not exist - std::deque::iterator i; - for (i=chain.begin();i!=chain.end();++i) - { - // std::cout << " cur = '"<<(*i)->GetLabel()<<"'"<GetType()+1); - - parent_id = cur_id; - } - return parent; - } - //===================================================================== - - - - //===================================================================== - void SQLiteTreeHandler::DBRecursiveGetOrCreateNode(Node* alien_node, - Node* parent, - const std::string& parent_id, - UpdateSummary& summary) - { - // std::cout << "SQLiteTreeHandler::RecursiveGetOrCreateNode('" - // <GetLabel() - // <<"','"<GetChildrenList().begin(); - i != alien_node->GetChildrenList().end(); - i++) - { - DBRecursiveGetOrCreateNode((*i),new_node,new_id,summary); - } - } - //===================================================================== - - - //===================================================================== - Node* SQLiteTreeHandler::DBGetOrCreateNode(Node* alien_node, - Node* internal_parent, - std::string parent_id, - std::string& node_id, - UpdateSummary& summary) - { - // std::cout << "DBGetOrCreateNode('"<GetLabel()<<"','" - // << internal_parent << "','"<< parent_id<<"')"<0) - { - node_id = node->UnsafeGetFieldValue("ID"); - return node; - } - // Second : try in DB - - // Does not exist : Create new one - node = new Node(alien_node->GetType(),this,internal_parent); - node->SetChildrenLoaded(true); - // Copy fields values from alien - Node::FieldValueMapType::iterator i,j; - for (i = node->GetFieldValueMap().begin(); - i != node->GetFieldValueMap().end(); - i++) - { - j = alien_node->GetFieldValueMap().find(i->first); - if (j != alien_node->GetFieldValueMap().end() ) - { - i->second = j->second; - } - } - - msw[2].Resume(); - if (node->GetType()!=Node::Patient) - node->SetFieldValue("PARENT_ID",parent_id); - - // Insert in DB - std::string val; - BuildSQLFieldsValues(node,val); - std::string insert("INSERT INTO "); - insert += std::string(SQLiteTreeHandlerStructure::Table(node->GetType())) - + " " + val + ";"; - // std::cout << "** SQL = '"<lastRowId(); - std::stringstream ri; - ri << mDB->lastRowId(); - node_id = ri.str(); - // std::cout << "LastRowId='"<lastRowId()<<"' vs '"<SetFieldValue("ID",node_id); - // Insert in TypeId map - TypeId ti; - ti.type = node->GetType(); - ti.id = node_id; - mTypeIdToNodeMap[ti] = node; - // std::cout << "== Insert TypeId ("<GetType()==Node::Patient) summary.added_patients++; - if (node->GetType()==Node::Study) summary.added_studies++; - if (node->GetType()==Node::Series) summary.added_series++; - if (node->GetType()==Node::Image) summary.added_images++; - - return node; - } - //===================================================================== - - //===================================================================== - Node* SQLiteTreeHandler::GetChildrenLike(Node* parent, - Node* alien_node) - { - Node::ChildrenListType::iterator i; - for (i = parent->GetChildrenList().begin(); - i != parent->GetChildrenList().end(); - i++) - { - Node::Type type = alien_node->GetType(); - bool ok = true; - for (int j=0; - jGetFieldValue(SQLiteTreeHandlerStructure:: - QueryField(type,j).key ) != - (*i)->GetFieldValue(SQLiteTreeHandlerStructure:: - QueryField(type,j).key ) ) - { - ok = false; - break; - } - } - if (ok) - { - return (*i); - } - } - return 0; - } - //===================================================================== - - //===================================================================== - std::string SQLiteTreeHandler::DBGetNodeId(Node* node, - const std::string& parent_id) - { - // std::cout << "SQLiteTreeHandler::DBGetNodeId('"<GetLabel() - // <<"','"<GetType(); - - std::string table = SQLiteTreeHandlerStructure::Table(type); - std::string where = "WHERE "; - - if (type!=Node::Patient) - { - where += "PARENT_ID='" + parent_id - //node->GetFieldValue("PARENT_ID") - + "' AND "; - } - - for (int i=0;iGetParent()) - { - node->GetParent()->RemoveChildrenFromList(node); - } - delete node; - // std::cout << "DELETE OK"<GetLabel()<<"')"<GetType()); - query += " WHERE ID='"+ node->GetFieldValue("ID") + "';"; - - UPDATEDB(query); - - Node::ChildrenListType::iterator i; - for (i = node->GetChildrenList().begin(); - i != node->GetChildrenList().end(); - i++) - { - DBRecursiveRemoveNode((*i)); - } - } - - //===================================================================== - - //===================================================================== - int SQLiteTreeHandler::DBQueryNumberOfChildren(Node* node) - { - std::string query = "SELECT COUNT (ID) FROM "; - query += SQLiteTreeHandlerStructure::Table(node->GetType()+1); - if (node->GetType() != Node::Database) - { - query += " WHERE PARENT_ID='"+ node->GetFieldValue("ID")+"'"; - } - query += ";"; - - // std::cout << "**SQL = "<< query << std::endl; - - CppSQLite3Query q; - QUERYDB(query,q); - - // std::cout << "**RES = "<< q.getIntField(0) < TypeIdToNodeMapType; - TypeIdToNodeMapType mTypeIdToNodeMap; - */ + }; // EO class SQLiteTreeHandler //======================================================================= diff --git a/src2/creaImageIOTreeAttributeDescriptor.cpp b/src2/creaImageIOTreeAttributeDescriptor.cpp index 08fd784..c6a694f 100644 --- a/src2/creaImageIOTreeAttributeDescriptor.cpp +++ b/src2/creaImageIOTreeAttributeDescriptor.cpp @@ -183,15 +183,11 @@ namespace creaImageIO { // Numerical typ = 1; -// type="1"; -// sscanf(type.c_str(),"%u",&typ); } else { // String typ = 2; - // type="2"; -// sscanf(type.c_str(),"%u",&typ); } } diff --git a/src2/creaImageIOTreeAttributeDescriptor.h b/src2/creaImageIOTreeAttributeDescriptor.h index 68f0da9..1ae86dd 100644 --- a/src2/creaImageIOTreeAttributeDescriptor.h +++ b/src2/creaImageIOTreeAttributeDescriptor.h @@ -83,7 +83,10 @@ namespace creaImageIO ///Decodes the type of attribute into the existing ones void DecodeType(unsigned int& type) const; + /// Determines if Attribute is a date bool isDateEntry() const; + + /// Determines if Attribute is a time bool isTimeEntry() const; private: diff --git a/src2/creaImageIOTreeDescriptor.cpp b/src2/creaImageIOTreeDescriptor.cpp index c1dca8e..80244d0 100644 --- a/src2/creaImageIOTreeDescriptor.cpp +++ b/src2/creaImageIOTreeDescriptor.cpp @@ -21,6 +21,7 @@ namespace creaImageIO const unsigned int AttributeDescriptor::IDENTIFIER = 2; /// The attribute can be edited const unsigned int AttributeDescriptor::EDITABLE = 3; + /// the attribute describes the node const unsigned int AttributeDescriptor::LABEL = 4; //================================================================== diff --git a/src2/creaImageIOTreeHandlerImageAdder.cpp b/src2/creaImageIOTreeHandlerImageAdder.cpp index f0f5bf3..ad88ef7 100644 --- a/src2/creaImageIOTreeHandlerImageAdder.cpp +++ b/src2/creaImageIOTreeHandlerImageAdder.cpp @@ -412,7 +412,7 @@ namespace creaImageIO std::string databaseVal; mTreeHandler->GetAttribute("Image","FullFileName",file,a->GetKey(),databaseVal); std::string fileVal=attr.find(a->GetKey())->second; - if ( a->GetFlags()==0 && databaseVal.compare(fileVal)!=0 ) + if ( a->GetFlags()==0 && databaseVal == fileVal) { if(repair) { diff --git a/src2/creaImageIOTreeNode.h b/src2/creaImageIOTreeNode.h index fca904c..55d6ab5 100644 --- a/src2/creaImageIOTreeNode.h +++ b/src2/creaImageIOTreeNode.h @@ -83,22 +83,31 @@ namespace creaImageIO /// Remove the given children from the children list int RemoveChildrenFromList(Node*); - + + /// Get the Attributes Map AttributeMapType& GetAttributeMap() { return mAttributeMap; } + + /// Get the Attributes Map const AttributeMapType& GetAttributeMap() const { return mAttributeMap; } + + /// Get the Attribute for a specific key const std::string& GetAttribute(const std::string& k) const; - const std::string& GetCleanAttribute(const std::string& k) const; - const std::string& UnsafeGetAttribute(const std::string& k) const - { return mAttributeMap.find(k)->second; } + + /// Get the Attribute for a specific key without OS dependance (not implemented) + // TODO : backslash OS uniformity + const std::string& GetCleanAttribute(const std::string& k) const; + + /// Set an Attribute for a specific key void SetAttribute(const std::string& k, const std::string& v); + + /// Set an Attribute for a specific key(unsafe mode) void UnsafeSetAttribute(const std::string& k, const std::string& v) { mAttributeMap[k] = v; } + /// Get Descriptor for an Attribute const AttributeDescriptor& GetAttributeDescriptor(const std::string& k)const; - // { return GetTypeDescription().GetFieldDescription(k); } - - - /// Returns true iff the KEY attributes of the node match those of the map provided + + /// Returns true if the KEY attributes of the node match those of the map provided bool Matches( const AttributeMapType& ) const; /// Returns the node data casted into the type T @@ -111,14 +120,12 @@ namespace creaImageIO /// Sorts the children of the node void SortChildren(const LexicographicalComparator&); + /// Print the node virtual void Print() const; + + /// Get the Label of the node std::string GetLabel() const; - /* - int ImageGetRows() const; - int ImageGetColumns() const; - int ImageGetFrames() const; - const std::string& ImageGetFullFileName() const { return UnsafeGetAttribute("FullFileName"); } - */ + private: /// The parent of the node diff --git a/src2/creaImageIOUltrasonixImageReader.cpp b/src2/creaImageIOUltrasonixImageReader.cpp index 8b07ad1..014e095 100644 --- a/src2/creaImageIOUltrasonixImageReader.cpp +++ b/src2/creaImageIOUltrasonixImageReader.cpp @@ -172,9 +172,7 @@ namespace creaImageIO void UltrasonixImageReader::ReadAttributes(const std::string& filename, std::map& attr) { - // std::cout << "UltrasonixImageReader::ReadDicomInfo '"<::iterator i; if ( (i = attr.find("FullFileName")) != attr.end()) { - // boost::filesystem::path full_path(filename); - // std::string f = full_path.leaf(); i->second = filename; } if ( (i = attr.find("D0004_1500")) != attr.end()) diff --git a/src2/creaImageIOUltrasonixImageReader.h b/src2/creaImageIOUltrasonixImageReader.h index 29a58a2..6ba7b42 100644 --- a/src2/creaImageIOUltrasonixImageReader.h +++ b/src2/creaImageIOUltrasonixImageReader.h @@ -21,13 +21,17 @@ namespace creaImageIO UltrasonixImageReader(); virtual ~UltrasonixImageReader(); - + /// Add file extensions read by the reader virtual void PushBackExtensions(std::vector&); + /// Test if file is read by this reader virtual bool CanRead(const std::string& filename); + /// return for a file a 2D VTkImage virtual vtkImageData* ReadImage(const std::string& filename); + /// Read the attributes for a file virtual void ReadAttributes(const std::string& filename, tree::AttributeMapType& attr); + }; //===================================================================== diff --git a/src2/creaImageIOVtkImageReader.cpp b/src2/creaImageIOVtkImageReader.cpp index 69dd65f..cd93e86 100644 --- a/src2/creaImageIOVtkImageReader.cpp +++ b/src2/creaImageIOVtkImageReader.cpp @@ -38,9 +38,6 @@ namespace creaImageIO //===================================================================== bool VtkImageReader::CanRead(const std::string& filename) { - // std::cout << "## Reader "<CanReadFile(filename.c_str())!=0); } //===================================================================== @@ -48,9 +45,6 @@ namespace creaImageIO //===================================================================== vtkImageData* VtkImageReader::ReadImage(const std::string& filename) { - // std::cout << "## Reader "<& attr) { - // std::cout << "VtkImageReader::ReadDicomInfo '"<::iterator i; + + std::map::iterator i; if ( (i = attr.find("FullFileName")) != attr.end()) { - // boost::filesystem::path full_path(filename); - // std::string f = full_path.leaf(); i->second = filename; } if ( (i = attr.find("D0004_1500")) != attr.end()) @@ -152,7 +141,7 @@ namespace creaImageIO if ( (i = attr.find("D0028_0012")) != attr.end()) { - i->second = planes; + i->second = planes; } if ( (i = attr.find("FullFileDirectory")) != attr.end()) { diff --git a/src2/creaImageIOVtkImageReader.h b/src2/creaImageIOVtkImageReader.h index 3ae6a43..b971210 100644 --- a/src2/creaImageIOVtkImageReader.h +++ b/src2/creaImageIOVtkImageReader.h @@ -26,9 +26,13 @@ namespace creaImageIO virtual ~VtkImageReader(); + /// Add file extensions read by the reader virtual void PushBackExtensions(std::vector&); + /// Test if file is read by this reader virtual bool CanRead(const std::string& filename); + /// return for a file a 2D VTkImage virtual vtkImageData* ReadImage(const std::string& filename); + /// Read the attributes for a file virtual void ReadAttributes(const std::string& filename, tree::AttributeMapType& attr); diff --git a/src2/creaImageIOWxViewer.cpp b/src2/creaImageIOWxViewer.cpp index 4200963..193fedb 100644 --- a/src2/creaImageIOWxViewer.cpp +++ b/src2/creaImageIOWxViewer.cpp @@ -26,21 +26,11 @@ namespace creaImageIO {} void* Entry(); - // void SetImagesToPlay(std::vector im); - // void ShowImage(vtkImageData* v); - // void StartIterator(); void OnExit(); private: - //std::vector mImagesToPlay; - //vtkImageViewer2* mViewer; - /// Associated wxvtk interactor - //crea::creawxVTKRenderWindowInteractor *mInteractor; - //std::vector::iterator i; + WxViewer* mWxViewer; - - // int mx1,mx2,my1,my2,mz1,mz2; - // double mspx,mspy,mspz; }; //===================================================================== -- 2.45.1