std::cout << "$$$$ "<<std::endl;
 
        //Puts images
-       std::vector<vtkImageData*> images;
-          w.GetSelectedImages(images,3);
+    /*   std::vector<vtkImageData*> images;
+          w.GetSelectedImages(images,3);*/
 
        
        // First Exemple:
 
 
 
-          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)
 
 */
 
 
-#include <creaImageIODicomImageReader2.h>
+#include "creaImageIODicomImageReader2.h"
+#include <creaImageIOTreeAttributeDescriptor.h>
 #include "gdcmStringFilter.h"
-#include "vtkGDCMImageReader.h"
-
-#include <creaImageIOSystem.h>
+#include "gdcmUIDs.h"
 #include "boost/filesystem/path.hpp"
 
-#include <creaImageIOTreeAttributeDescriptor.h>
+#include "vtkGDCMImageReader.h"
 #include <vtkStringArray.h>
-#include <creaImageIOGimmick.h>
+#if defined(_WIN32)
+#pragma warning(disable: 4996)
+#endif
 
-#include "gdcmUIDs.h"
 #ifdef _DEBUG
 #define new DEBUG_NEW
 #endif
   void DicomImageReader::ReadAttributes(const std::string& filename, 
                      std::map<std::string,std::string>& attr)
   {
-    GimmickMessage(2,"Reading attributes from DICOM file '"
-                  <<filename<<"'"<<std::endl);
 
    
       gdcm::Reader reader;
 
 */
 
 #include <creaImageIODicomScanner.h>
-#include "creaImageIOSystem.h"
+
 #include <boost/filesystem.hpp>
 #include "boost/algorithm/string.hpp"
-
-
-
-#include <creaImageIOSystem.h>
 #include "boost/filesystem/path.hpp"
 
-#include <creaImageIOTreeAttributeDescriptor.h>
-#include <vtkStringArray.h>
-#include <creaImageIOGimmick.h>
-#include <gdcmDirectory.h>
-
 #include <fstream>
-
+#if defined(_WIN32)
+#pragma warning(disable: 4996)
+#endif
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
 
 #include <gdcmReader.h>
 #include <vtkGDCMImageReader.h>
 #include <gdcmScanner.h>
+#include <vtkStringArray.h>
+#include <gdcmDirectory.h>
 #endif
 
 class vtkGDCMImageReader;
 
 */
 
 #include <creaImageIOGimmick.h>
-#include <creaImageIOSystem.h>
+
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
 
 #endif
 #include <creaImageIOGimmick.h>
 
+#if defined(_WIN32)
+#pragma warning(disable: 4996)
+#endif
+
 #ifdef _DEBUG
 #define new DEBUG_NEW
 #endif
 
 
 
 #include <creaImageIOGimmickView.h>
-#include <creaImageIOSystem.h>
+
 #include "boost/filesystem.hpp"
 
 #if defined(USE_GDCM)
 #include "gdcmAnonymizer.h"
 #include "gdcmGlobal.h"
 #endif*/
-
+#if defined(_WIN32)
+#pragma warning(disable: 4996)
+#endif
 
 namespace fs = boost::filesystem;
 namespace creaImageIO
 
                        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);
 
                        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();
 
                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];
                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];
                std::vector<std::string>::iterator it;
                std::vector<OutStrGimmick>::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 <dim[2]; slice++)
                                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)
                {
                        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];
        void GimmickView::readImages(std::vector<OutStrGimmick>& o_output, std::vector<std::string> im,
                         OutputAttr i_attr, int i_dim, double i_zspc)
        {
-               int size = im.size();
+               int size = (int)im.size();
                if ( size == 0)
                {
                        return;
 
     /// 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();
     //======================================================================
 
                // 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<size;++i) 
                {
                        if (i_str[i]==0) 
 
                                        }
                                }
                                std::sort (names.begin(), names.end()); // make sure names are in lexicographical order
-                               int lgr = names.size();
+                               int lgr = (int)names.size();
                                
                                for(int i=0; i<lgr; i++)
                                {
 
 #define __creaImageIOTree_h_INCLUDED__
 
 #include <creaImageIOTreeNode.h>
+#include <creaImageIOTreeDescriptor.h>
 
 namespace creaImageIO
 {
 
 
 
 #include <creaImageIOTreeAttributeDescriptor.h>
-#include <creaImageIOSystem.h>
+
+
+#if defined(_WIN32)
+#pragma warning(disable: 4996)
+#endif
 
 #if defined(USE_GDCM)
 #include <gdcmGlobal.h>
       //    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<size;++i) 
        {
          if (str[i]==0) 
 
 #ifndef __creaImageIOTreeAttributeDescriptor_h_INCLUDED__
 #define __creaImageIOTreeAttributeDescriptor_h_INCLUDED__
 
+#include <creaImageIOSystem.h>
 #include <string>
 //#include <iostream>
 
 
 
       /// 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
 
                                AddFile(*i);
                        }
                        }
-                       nf+=newFiles.size();
+                       nf+=(int)newFiles.size();
                        newFiles.clear();
 
                }
 
 
       /// 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&);
 
        {
          GetChildrenList().erase(i);
        }
-       return GetChildrenList().size();
+       return (int)GetChildrenList().size();
     }
     //=============================================================
 
 
 #ifndef __creaImageIOTreeNode_h_INCLUDED__
 #define __creaImageIOTreeNode_h_INCLUDED__
 
-#include <creaImageIOTreeDescriptor.h>
+#include <creaImageIOTreeLevelDescriptor.h>
 #include <creaImageIOTreeComparators.h>
 #include<boost/filesystem/operations.hpp>
 #include <vector>
       /// 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; }
 
 #include "creaImageIOUltrasonixImageReader.h"
 #include <creaVtk.h>
 #include <boost/filesystem/path.hpp>
+
+#if defined(_WIN32)
+#pragma warning(disable: 4996)
+#endif
+
 namespace creaImageIO
 {
 #define HEADER_SIZE    19
 
 
 #include <creaImageIOVtkImageReader.h>
 #include <vtkImageReader2.h>
-#include <creaImageIOSystem.h>
+
 #include "boost/filesystem/path.hpp"
+#if defined(_WIN32)
+#pragma warning(disable: 4996)
+#endif
 
 namespace creaImageIO{
   //=====================================================================
       {
        SetName ( name );
       }
-    GimmickDebugMessage(5,"Constructing vtkImageReader : "<<GetName()
-                       <<std::endl);
+
       
   }
   //=====================================================================
   void VtkImageReader::ReadAttributes(const std::string& filename, 
                                      std::map<std::string,std::string>& attr)
   {
-    GimmickMessage(2,"Reading attributes from '"<<filename<<std::endl);
+
     // Get image dimensions
     // How to get the image info without loading it in vtk ?
     mReader->SetFileName(filename.c_str());
                 i->second = filename.substr(0, last_pos);
          }
 
-    GimmickMessage(2,"Attributes map:"<<std::endl<<attr<<std::endl);
+
   }
   //=====================================================================
 
 
 
 
 #include <creaImageIOWxDumpPanel.h>
-#include <creaImageIOSystem.h>
+
 #include <creaImageIOGimmick.h>
 #include <boost/algorithm/string.hpp>
 #if defined(USE_GDCM)
                                   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;
 
 */
 
 
-#include <creaImageIOPACSConnection.h>
+
 #include <creaImageIOWxPACSConnectionPanel.h>
-#include <creaImageIOWxGimmickView.h>
 #include <creaImageIOWxTreeView.h>
-#include <creaImageIOSystem.h>
 #include <creaImageIOWxCustomizeConfigPanel.h>
 #include <creaImageIOWxListenerPanel.h>
 #include <creaImageIOWxEditFieldsPanel.h>
 #include <creaImageIOWxOutputDlg.h>
 #include <creaImageIOOutputModel.h>
 
+#if defined(_WIN32)
+#pragma warning(disable: 4996)
+#endif
+
 using namespace crea;
 // Icons
 #include "icons/accept.xpm"
 
     : wxDialog(parent, -1,_T("OUTPUT FORMAT"), wxDefaultPosition, wxSize(350,450))
    {
 
-               int size = filenames.size();
+               int size = (int)filenames.size();
                
                int deflt = 1;
 
 
                                dlg.stopReading();
                                dlg.getSelected(out, attr,true,"");
                        m_results.clear();
-                       int size=out.size();
+                       int size=(int)out.size();
                        int ii;
                        if(!bInfo)
                        {
 
 */
 
 #include "creaImageIOSimpleView.h"
-#include <creaWx.h>
+
 #include "creaImageIOWxGimmickReaderDialog.h"
 namespace creaImageIO
 {
 
 
 #include <creaImageIOWxTreeView.h>
 #include <creaImageIOGimmickView.h>
-#include <creaImageIOSystem.h>
+
 #include <wx/splitter.h>
 #include <wx/gdicmn.h>
 #include <boost/date_time/gregorian/gregorian.hpp>
                                                                                 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 
        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]);
        
     GimmickDebugMessage(7,
                        "WxTreeView::ValidateSelectedImages" 
                        <<std::endl);
-    const std::vector<tree::Node*>& sel(GetSelected(mLevelList.size()+1));
+    const std::vector<tree::Node*>& sel(GetSelected((int)mLevelList.size()+1));
     GetGimmickView()->OnSelectionChange(sel,
                                        isSelection,(mLastSelected-1),
                                        !mIgnoreSelectedChanged);
   void WxTreeView::GetNodes(std::vector<tree::Node*>& 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 ( ;; )
                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);
                }
   // Should be in another place : not specific !
   void WxTreeView::GetSelectedAsString(std::vector<std::string>&s)
   {
-    int level=mLevelList.size();
+    int level= (int)mLevelList.size();
     const std::vector<tree::Node*>& sel=GetSelected(level+1);
     std::vector<tree::Node*>::const_iterator i;
     
 
       /// 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<tree::Node*>& GetSelected(int level);
 
 */
 
 #include <creaImageIOWxViewer.h>
-#include <creaImageIOSystem.h>
+
 #include <fstream>
 #include <vtkCamera.h>
 #include <vtkRenderer.h>
 #include <vtkImageData.h>
-#include <creawxVTKRenderWindowInteractor.h>
 #include <creaMessageManager.h>
 #include <stdio.h>
 #include <time.h>
        GimmickDebugMessage(6,"WxViewer::SetImageVector"<<std::endl);
        imagePointers=pointers;
        
-       mslide->SetMax(pointers.size());
+       mslide->SetMax((int)pointers.size());
        mslide->SetMin(1);
        // Refresh don't work, TO MODIFY
        mslide->Refresh();
 
 #include <wx/imaglist.h>
 #include <wx/splitter.h>
 
-#include <creaImageIOSystem.h>
+
 #include <creaImageIOImagePointerHolder.h>
 
 // For image preview