From: fcervenansky Date: Wed, 3 Apr 2013 16:05:19 +0000 (+0200) Subject: Bug #1963 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f5357d5e24ce935ff82ebb98d21dc95185c3528e;p=creaImageIO.git Bug #1963 + cleanup --- diff --git a/appli/TestWxGimmickReaderDialog/main.cxx b/appli/TestWxGimmickReaderDialog/main.cxx index ee0ec18..a8265ec 100644 --- a/appli/TestWxGimmickReaderDialog/main.cxx +++ b/appli/TestWxGimmickReaderDialog/main.cxx @@ -112,8 +112,8 @@ bool myApp::OnInit( ) std::cout << "$$$$ "< images; - w.GetSelectedImages(images,3); + /* std::vector images; + w.GetSelectedImages(images,3);*/ // First Exemple: @@ -175,9 +175,9 @@ bool myApp::OnInit( ) - crea::VtkBasicSlicer(out.front().img); - images.front()->Delete(); - w.OnExit(); + //crea::VtkBasicSlicer(out.front().img); + // images.front()->Delete(); + // w.OnExit(); } else if (w.GetReturnCode() == wxID_CANCEL) diff --git a/src/creaImageIODicomImageReader2.cpp b/src/creaImageIODicomImageReader2.cpp index aa67c76..5b6861c 100644 --- a/src/creaImageIODicomImageReader2.cpp +++ b/src/creaImageIODicomImageReader2.cpp @@ -26,18 +26,18 @@ */ -#include +#include "creaImageIODicomImageReader2.h" +#include #include "gdcmStringFilter.h" -#include "vtkGDCMImageReader.h" - -#include +#include "gdcmUIDs.h" #include "boost/filesystem/path.hpp" -#include +#include "vtkGDCMImageReader.h" #include -#include +#if defined(_WIN32) +#pragma warning(disable: 4996) +#endif -#include "gdcmUIDs.h" #ifdef _DEBUG #define new DEBUG_NEW #endif @@ -156,8 +156,6 @@ namespace creaImageIO void DicomImageReader::ReadAttributes(const std::string& filename, std::map& attr) { - GimmickMessage(2,"Reading attributes from DICOM file '" - < -#include "creaImageIOSystem.h" + #include #include "boost/algorithm/string.hpp" - - - -#include #include "boost/filesystem/path.hpp" -#include -#include -#include -#include - #include - +#if defined(_WIN32) +#pragma warning(disable: 4996) +#endif #ifdef _DEBUG #define new DEBUG_NEW diff --git a/src/creaImageIODicomScanner.h b/src/creaImageIODicomScanner.h index 96067da..adeea2a 100644 --- a/src/creaImageIODicomScanner.h +++ b/src/creaImageIODicomScanner.h @@ -34,6 +34,8 @@ #include #include #include +#include +#include #endif class vtkGDCMImageReader; diff --git a/src/creaImageIOGimmick.cpp b/src/creaImageIOGimmick.cpp index 3539510..6d29613 100644 --- a/src/creaImageIOGimmick.cpp +++ b/src/creaImageIOGimmick.cpp @@ -26,7 +26,7 @@ */ #include -#include + #include #include @@ -36,6 +36,10 @@ #endif #include +#if defined(_WIN32) +#pragma warning(disable: 4996) +#endif + #ifdef _DEBUG #define new DEBUG_NEW #endif diff --git a/src/creaImageIOGimmickView.cpp b/src/creaImageIOGimmickView.cpp index 0af8ded..245b0b5 100644 --- a/src/creaImageIOGimmickView.cpp +++ b/src/creaImageIOGimmickView.cpp @@ -27,7 +27,7 @@ #include -#include + #include "boost/filesystem.hpp" #if defined(USE_GDCM) @@ -46,7 +46,9 @@ #include "gdcmAnonymizer.h" #include "gdcmGlobal.h" #endif*/ - +#if defined(_WIN32) +#pragma warning(disable: 4996) +#endif namespace fs = boost::filesystem; namespace creaImageIO @@ -382,11 +384,11 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect if(ext[5] == 0) { - ext[5] = im.size()-1; + ext[5] = (int)im.size()-1; } else { - ext[5] = ext[5] * im.size()-1; // to deal with multiframes - JPR + ext[5] = ext[5] * (int)im.size()-1; // to deal with multiframes - JPR } out->SetExtent(ext); @@ -395,7 +397,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect int dim[3]; first->GetDimensions(dim); - out->SetDimensions(dim[0], dim[1], im.size() ); + out->SetDimensions(dim[0], dim[1], (int)im.size() ); out->AllocateScalars(); out->Update(); @@ -517,11 +519,11 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect first->GetWholeExtent(ext); // send also 0,0 in Z if(ext[5] == 0) { - ext[5] = im.size()-1; + ext[5] = (int)im.size()-1; } else { - ext[5] = ext[5] * im.size()-1; // to deal with multiframes + ext[5] = ext[5] * (int)im.size()-1; // to deal with multiframes } out.img->SetExtent(ext); int dim[3]; @@ -529,7 +531,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect first->GetDimensions(dim); first->GetSpacing(spac); out.img->SetSpacing(spac); - out.img->SetDimensions(dim[0], dim[1], im.size() ); + out.img->SetDimensions(dim[0], dim[1], (int)im.size() ); out.img->AllocateScalars(); out.img->Update(); unsigned long imsize = dim[0] * dim[1]; @@ -573,7 +575,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect std::vector::iterator it; std::vector::iterator it_out = o_output.begin(); - for (it=im.begin(); it!=im.end(); ++it, it_out += dim[2]) + for (it=im.begin(); it!=im.end(); ++it)//, it_out ++) { vtkImageData* cur = mReader.GetImage( (*it) ); for (int slice= 0 ; slice & s, std::vect memcpy(out.img->GetScalarPointer(0,0,0), cur->GetScalarPointer(0,0,slice), imsize); o_output.push_back(out); } - if(i_attr.mult) - getAttributes((*it),(*it_out).infos,i_attr); + // if(i_attr.mult) + // getAttributes((*it),(*it_out).infos,i_attr); } if(!i_attr.mult) { @@ -630,7 +632,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect out.img->SetExtent(ext); first->GetSpacing(spac); out.img->SetSpacing(spac); - out.img->SetDimensions(dim[0], dim[1], im.size() ); + out.img->SetDimensions(dim[0], dim[1], (int)im.size() ); out.img->AllocateScalars(); out.img->Update(); unsigned long imsize = dim[0] * dim[1]; @@ -659,7 +661,7 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect void GimmickView::readImages(std::vector& o_output, std::vector im, OutputAttr i_attr, int i_dim, double i_zspc) { - int size = im.size(); + int size = (int)im.size(); if ( size == 0) { return; diff --git a/src/creaImageIOIndexedHeap.h b/src/creaImageIOIndexedHeap.h index f1177b0..0ae6a82 100644 --- a/src/creaImageIOIndexedHeap.h +++ b/src/creaImageIOIndexedHeap.h @@ -104,7 +104,7 @@ namespace creaImageIO /// removes and returns the nth element T remove(int n); /// returns the size of the Heap - inline int size() const {return m_p.size(); } + inline int size() const {return (int)m_p.size(); } /// empties the Heap void clear(); //====================================================================== diff --git a/src/creaImageIOSQLiteTreeHandler.cpp b/src/creaImageIOSQLiteTreeHandler.cpp index 562aa6d..4a1e391 100644 --- a/src/creaImageIOSQLiteTreeHandler.cpp +++ b/src/creaImageIOSQLiteTreeHandler.cpp @@ -570,7 +570,7 @@ namespace creaImageIO // quote must be doubled boost::algorithm::replace_all(i_str,"'","''"); // Found strange strings which contained NULL char INSIDE string - int i,size=i_str.size(); + int i,size=(int)i_str.size(); for (i=0;i +#include namespace creaImageIO { diff --git a/src/creaImageIOTreeAttributeDescriptor.cpp b/src/creaImageIOTreeAttributeDescriptor.cpp index e078927..402872e 100644 --- a/src/creaImageIOTreeAttributeDescriptor.cpp +++ b/src/creaImageIOTreeAttributeDescriptor.cpp @@ -27,7 +27,11 @@ #include -#include + + +#if defined(_WIN32) +#pragma warning(disable: 4996) +#endif #if defined(USE_GDCM) #include @@ -55,7 +59,7 @@ namespace creaImageIO // crea::Utils::Replace( str, "'", "''" ); boost::algorithm::replace_all(str,"'","''"); // Found strange strings which contained NULL char INSIDE string - int i,size=str.size(); + int i,size=(int)str.size(); for (i=0;i #include //#include diff --git a/src/creaImageIOTreeDescriptor.h b/src/creaImageIOTreeDescriptor.h index 58eddfc..ea3c487 100644 --- a/src/creaImageIOTreeDescriptor.h +++ b/src/creaImageIOTreeDescriptor.h @@ -61,7 +61,7 @@ namespace creaImageIO /// Returns the number of levels of the tree unsigned int GetNumberOfLevels() - { return mLevelDescriptorList.size(); } + { return (int)mLevelDescriptorList.size(); } /// Returns the LevelDescriptor of a given level (const ref) const LevelDescriptor& GetLevelDescriptor(int level) const diff --git a/src/creaImageIOTreeHandlerImageAdder.cpp b/src/creaImageIOTreeHandlerImageAdder.cpp index ff4683d..ae72e44 100644 --- a/src/creaImageIOTreeHandlerImageAdder.cpp +++ b/src/creaImageIOTreeHandlerImageAdder.cpp @@ -481,7 +481,7 @@ namespace creaImageIO AddFile(*i); } } - nf+=newFiles.size(); + nf+=(int)newFiles.size(); newFiles.clear(); } diff --git a/src/creaImageIOTreeLevelDescriptor.h b/src/creaImageIOTreeLevelDescriptor.h index 552802e..fa8e484 100644 --- a/src/creaImageIOTreeLevelDescriptor.h +++ b/src/creaImageIOTreeLevelDescriptor.h @@ -54,7 +54,7 @@ namespace creaImageIO /// Returns the number of attributes of the level unsigned int GetNumberOfAttributes() const - { return mAttributeDescriptorList.size(); } + { return (int)mAttributeDescriptorList.size(); } /// Adds the AttributeDescriptor to the list void Add(const AttributeDescriptor&); diff --git a/src/creaImageIOTreeNode.cpp b/src/creaImageIOTreeNode.cpp index af10c23..2c77532 100644 --- a/src/creaImageIOTreeNode.cpp +++ b/src/creaImageIOTreeNode.cpp @@ -164,7 +164,7 @@ namespace creaImageIO { GetChildrenList().erase(i); } - return GetChildrenList().size(); + return (int)GetChildrenList().size(); } //============================================================= diff --git a/src/creaImageIOTreeNode.h b/src/creaImageIOTreeNode.h index bd52991..5d21826 100644 --- a/src/creaImageIOTreeNode.h +++ b/src/creaImageIOTreeNode.h @@ -29,7 +29,7 @@ #ifndef __creaImageIOTreeNode_h_INCLUDED__ #define __creaImageIOTreeNode_h_INCLUDED__ -#include +#include #include #include #include @@ -96,7 +96,7 @@ namespace creaImageIO /// Warning : if the children are not loaded then might return 0 /// even if the node has children ! /// see TreeHandler::GetNumberOfChildren - unsigned int GetNumberOfChildren() const { return mChildren.size(); } + unsigned int GetNumberOfChildren() const { return (int)mChildren.size(); } /// Returns true iff the node's children are loaded bool GetChildrenLoaded() const { return mChildrenLoaded; } diff --git a/src/creaImageIOUltrasonixImageReader.cpp b/src/creaImageIOUltrasonixImageReader.cpp index 4116bb7..8c609d3 100644 --- a/src/creaImageIOUltrasonixImageReader.cpp +++ b/src/creaImageIOUltrasonixImageReader.cpp @@ -30,6 +30,11 @@ #include "creaImageIOUltrasonixImageReader.h" #include #include + +#if defined(_WIN32) +#pragma warning(disable: 4996) +#endif + namespace creaImageIO { #define HEADER_SIZE 19 diff --git a/src/creaImageIOVtkImageReader.cpp b/src/creaImageIOVtkImageReader.cpp index 9cf160b..d16137b 100644 --- a/src/creaImageIOVtkImageReader.cpp +++ b/src/creaImageIOVtkImageReader.cpp @@ -28,8 +28,11 @@ #include #include -#include + #include "boost/filesystem/path.hpp" +#if defined(_WIN32) +#pragma warning(disable: 4996) +#endif namespace creaImageIO{ //===================================================================== @@ -57,8 +60,7 @@ namespace creaImageIO{ { SetName ( name ); } - GimmickDebugMessage(5,"Constructing vtkImageReader : "<& attr) { - GimmickMessage(2,"Reading attributes from '"<SetFileName(filename.c_str()); @@ -197,7 +199,7 @@ namespace creaImageIO{ i->second = filename.substr(0, last_pos); } - GimmickMessage(2,"Attributes map:"< -#include + #include #include #if defined(USE_GDCM) @@ -199,13 +199,13 @@ namespace creaImageIO std::string resultat; tag = "(" + i_line.substr(0,9) + ")"; - line = i_line.substr(14,i_line.size()-10); - int pos1 = line.find_first_of("["); - int pos2 = line.find_first_of("]"); + line = i_line.substr(14,i_line.size()-10); + int pos1 = (int)line.find_first_of("["); + int pos2 = (int)line.find_first_of("]"); signification = line.substr(pos1+1, pos2-pos1-1); line = line.substr(pos2+1); - pos1 = line.find_first_of("["); - pos2 = line.find_first_of("]"); + pos1 = (int)line.find_first_of("["); + pos2 = (int)line.find_first_of("]"); value = line.substr(pos1+1, pos2-pos1-1); resultat = tag + " " + signification + ": " +value; return resultat; diff --git a/src/creaImageIOWxGimmickView.cpp b/src/creaImageIOWxGimmickView.cpp index c1b7acb..56a4f55 100644 --- a/src/creaImageIOWxGimmickView.cpp +++ b/src/creaImageIOWxGimmickView.cpp @@ -26,11 +26,9 @@ */ -#include + #include -#include #include -#include #include #include #include @@ -41,6 +39,10 @@ #include #include +#if defined(_WIN32) +#pragma warning(disable: 4996) +#endif + using namespace crea; // Icons #include "icons/accept.xpm" diff --git a/src/creaImageIOWxOutputDlg.cpp b/src/creaImageIOWxOutputDlg.cpp index db56702..8ed5f28 100644 --- a/src/creaImageIOWxOutputDlg.cpp +++ b/src/creaImageIOWxOutputDlg.cpp @@ -35,7 +35,7 @@ namespace creaImageIO : wxDialog(parent, -1,_T("OUTPUT FORMAT"), wxDefaultPosition, wxSize(350,450)) { - int size = filenames.size(); + int size = (int)filenames.size(); int deflt = 1; diff --git a/src/creaImageIOWxSimpleDlg.cpp b/src/creaImageIOWxSimpleDlg.cpp index f69261f..db55ad1 100644 --- a/src/creaImageIOWxSimpleDlg.cpp +++ b/src/creaImageIOWxSimpleDlg.cpp @@ -148,7 +148,7 @@ namespace creaImageIO dlg.stopReading(); dlg.getSelected(out, attr,true,""); m_results.clear(); - int size=out.size(); + int size=(int)out.size(); int ii; if(!bInfo) { diff --git a/src/creaImageIOWxSimpleDlg.h b/src/creaImageIOWxSimpleDlg.h index 9ef4f51..40b5526 100644 --- a/src/creaImageIOWxSimpleDlg.h +++ b/src/creaImageIOWxSimpleDlg.h @@ -26,7 +26,7 @@ */ #include "creaImageIOSimpleView.h" -#include + #include "creaImageIOWxGimmickReaderDialog.h" namespace creaImageIO { diff --git a/src/creaImageIOWxTreeView.cpp b/src/creaImageIOWxTreeView.cpp index a7a2c46..3c1f308 100644 --- a/src/creaImageIOWxTreeView.cpp +++ b/src/creaImageIOWxTreeView.cpp @@ -27,7 +27,7 @@ #include #include -#include + #include #include #include @@ -329,7 +329,7 @@ namespace creaImageIO wxLIST_STATE_SELECTED); if ( item == -1 ) break; - long adr = GetCtrl(l-1)->GetItemData(item); + long adr = (long)GetCtrl(l-1)->GetItemData(item); tree::Node* n = ((ItemData*)adr)->node; /* FCY 18-04-2011: don't understand the real purpose of these lines, if uncomment add last frame in first place @@ -789,7 +789,7 @@ namespace creaImageIO if ( it == -1 ) break; - long adr = GetCtrl(level)->GetItemData(it); + long adr = (long)GetCtrl(level)->GetItemData(it); tree::Node* nod = ((ItemData*)adr)->node; att=(*nod).GetAttribute(mLevelList[level].key[mColumnSelected]); @@ -1100,7 +1100,7 @@ namespace creaImageIO GimmickDebugMessage(7, "WxTreeView::ValidateSelectedImages" <& sel(GetSelected(mLevelList.size()+1)); + const std::vector& sel(GetSelected((int)mLevelList.size()+1)); GetGimmickView()->OnSelectionChange(sel, isSelection,(mLastSelected-1), !mIgnoreSelectedChanged); @@ -1113,9 +1113,9 @@ namespace creaImageIO void WxTreeView::GetNodes(std::vector& nodes, bool direction) { long item = mLastSelected; - int level=mLevelList.size()-1; + int level=(int)mLevelList.size()-1; //Gets current item data - long adr = GetCtrl(level)->GetItemData(item); + long adr = (long)GetCtrl(level)->GetItemData(item); //Extracts the node tree::Node* nod = ((ItemData*)adr)->node; for ( ;; ) @@ -1137,7 +1137,7 @@ namespace creaImageIO if(GetCtrl(level)->GetItemState(item, wxLIST_STATE_SELECTED)==0 ) { - adr = GetCtrl(level)->GetItemData(item); + adr = (long)GetCtrl(level)->GetItemData(item); nod = ((ItemData*)adr)->node; nodes.push_back(nod); } @@ -1163,7 +1163,7 @@ namespace creaImageIO // Should be in another place : not specific ! void WxTreeView::GetSelectedAsString(std::vector&s) { - int level=mLevelList.size(); + int level= (int)mLevelList.size(); const std::vector& sel=GetSelected(level+1); std::vector::const_iterator i; diff --git a/src/creaImageIOWxTreeView.h b/src/creaImageIOWxTreeView.h index 3b850d0..fbac52b 100644 --- a/src/creaImageIOWxTreeView.h +++ b/src/creaImageIOWxTreeView.h @@ -165,7 +165,7 @@ namespace creaImageIO /// return the wxSplitter of one level wxSplitterWindow* GetSplitter(int l) { return mLevelList[l].wxSplitter; } //Returns the maximum number of levels - int GetNumberOfLevels(){ return mLevelList.size(); } + int GetNumberOfLevels(){ return (int)mLevelList.size(); } /// Gets the user selected data from the level passed as a parameter /// Updates the vector if necessary const std::vector& GetSelected(int level); diff --git a/src/creaImageIOWxViewer.cpp b/src/creaImageIOWxViewer.cpp index 7942f62..7f15e40 100644 --- a/src/creaImageIOWxViewer.cpp +++ b/src/creaImageIOWxViewer.cpp @@ -26,12 +26,11 @@ */ #include -#include + #include #include #include #include -#include #include #include #include @@ -145,7 +144,7 @@ namespace creaImageIO GimmickDebugMessage(6,"WxViewer::SetImageVector"<SetMax(pointers.size()); + mslide->SetMax((int)pointers.size()); mslide->SetMin(1); // Refresh don't work, TO MODIFY mslide->Refresh(); diff --git a/src/creaImageIOWxViewer.h b/src/creaImageIOWxViewer.h index 01fb605..9647b3b 100644 --- a/src/creaImageIOWxViewer.h +++ b/src/creaImageIOWxViewer.h @@ -36,7 +36,7 @@ #include #include -#include + #include // For image preview