creaImageIOListener.cpp
)
-
-
# Attributed tree data structure
FILE(GLOB SOURCES_CREAIMAGEIO_TREE
creaImageIOTree.cpp
FILE(GLOB SOURCES_CREAIMAGEIO_IMG_DICOM_READER
creaImageIODicomImageReader.cpp)
ENDIF(USE_GDCM)
-
IF(USE_GDCM2)
FILE(GLOB SOURCES_CREAIMAGEIO_IMG_DICOM_READER
${SOURCES_CREAIMAGEIO_IMG_DICOM_READER}
)
-
# The wxWidgets-based components
if (USE_WXWIDGETS)
FILE(GLOB SOURCES_CREAIMAGEIO_WX
)
endif (BUILD_CREA_PACS)
-
-
-
OPTION(${LIBRARY_NAME}_BUILD_SHARED
"Build ${LIBRARY_NAME} as a shared library (dynamic) ?" ON)
IF (${LIBRARY_NAME}_BUILD_SHARED)
//=====================================================================
DicomImageReader::DicomImageReader()
{
- mReader = vtkGDCMImageReader::New();
- SetName ( "Dicom" );
+ mReader = vtkGDCMImageReader::New();
+ SetName ( "Dicom" );
};
//=====================================================================
//=====================================================================
DicomImageReader::~DicomImageReader()
{
- mReader->Delete();
+ mReader->Delete();
}
//=====================================================================
//=====================================================================
bool DicomImageReader::CanRead(const std::string& filename)
{
- gdcm::Reader reader;
+ gdcm::Reader reader;
reader.SetFileName( filename.c_str() );
return reader.Read();
<<filename<<"'"<<std::endl);
- gdcm::Reader reader;
+ gdcm::Reader reader;
reader.SetFileName( filename.c_str() );
- if (reader.Read())
+ if (reader.Read())
{
std::map<std::string,std::string>::iterator i;
for (i=attr.begin();i!=attr.end();++i)
{
uint16_t el;
uint16_t gr;
-
+
tree::AttributeDescriptor::GetDicomGroupElementFromKey(i->first,gr,el);
if ( ( gr!=0 ) && ( el!=0 ) )
{
void DicomImageReader::ReadAttributes2(const std::string& filename,
std::map<std::string,std::string>& attr)
{
-
if(!b_loaded)
{
std::map<std::string,std::string>::iterator i;
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- const std::string DicomImageReader::GetStringValueFromTag(const gdcm::DataElement& de)
+const std::string DicomImageReader::GetStringValueFromTag(const gdcm::DataElement& de)
{
static std::string buffer;
buffer = ""; // cleanup previous call
// Will be padded with at least one \0
}
-
// Since return is a const char* the very first \0 will be considered
return buffer.c_str();
}
#include <vtkMetaImageReader.h>
//#include <vtkGESignalReader.h>
-
#include "boost/filesystem/path.hpp"
namespace creaImageIO
{
-
-
-
-
//=====================================================================
ImageReader::ImageReader()
// std::cout << "#### ImageReader::ImageReader()"<<std::endl;
if (mUnreadableImage!=0) return;
- Register( boost::shared_ptr<AbstractImageReader>(new VtkImageReader(vtkPNGReader::New(), "PNG", ".png")));
+ Register( boost::shared_ptr<AbstractImageReader>(new VtkImageReader(vtkPNGReader::New(), "PNG", ".png")));
Register(boost::shared_ptr<AbstractImageReader>(new VtkImageReader(vtkTIFFReader::New(), "JPEG", ".jpeg")));
Register(boost::shared_ptr<AbstractImageReader>(new VtkImageReader(vtkJPEGReader::New())));
Register(boost::shared_ptr<AbstractImageReader>(new VtkImageReader(vtkBMPReader::New())));
mUnreadableImage->SetScalarComponentFromFloat(i,i,0,0,255);
mUnreadableImage->SetScalarComponentFromFloat(dim[0]-1-i,i,0,0,255);
}
-
-
-
}
//=====================================================================
}
}
return ok;
-
}
-
//=====================================================================
// Returns true iff the file is readable
bool ImageReader::CanRead( const std::string& filename )
}
}
return ok;
-
}
//=====================================================================
#include "creaImageIOWxSimpleDlg.h"
#include "creaImageIOWxGimmickReaderDialog.h"
-
namespace creaImageIO
{
///Ctor
- WxSimpleDlg::WxSimpleDlg(wxWindow *parent, wxString i_title)
+ WxSimpleDlg::WxSimpleDlg(wxWindow *parent, wxString i_title)
: wxDialog(parent, -1,_T("DISPLAY IMAGES"), wxDefaultPosition, wxSize(230,150))
{
if(!i_title.empty())
wxButton *gimmickBut = new wxButton(this, -1,_T("Select Gimmick"), wxPoint(10,70) );
Connect( gimmickBut->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxSimpleDlg::OnReadGimmick );
- //TO DO Button to select Bruker directory
+ /// \TODO Button to select Bruker directory
Layout();
}
//////////////////////////////////////////////////////////////////////
-// //
+// //
//////////////////////////////////////////////////////////////////////
void WxSimpleDlg::OnReadFile(wxCommandEvent& event)
{
void WxSimpleDlg::OnReadDirectory(wxCommandEvent &event)
{
long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
- wxDirDialog* FD = new wxDirDialog( 0, _T("Select the directory to display"), "", style);
+ wxDirDialog* FD = new wxDirDialog( 0, _T("Select the directory to display"), _T(""), style);
if (FD->ShowModal()==wxID_OK)
{
Close();
}
-
//////////////////////////////////////////////////////////////////////
// Return the results vector //
//////////////////////////////////////////////////////////////////////
#include "creaImageIOSimpleView.h"
#include <creaWx.h>
-
namespace creaImageIO
{
- /**
+ /**
* \ingroup View
*/
{
public:
/// Ctor
- WxSimpleDlg( wxWindow *parent, wxString i_title ="");
-
+ WxSimpleDlg( wxWindow *parent, wxString i_title =_T(""));
///Dtor
~WxSimpleDlg(){};
-
/// Callback to read file(s)
void OnReadFile(wxCommandEvent& event);
/// vtkImageData vector
std::vector<vtkImageData*> m_results;
};
-}
\ No newline at end of file
+}