From bbc91afaa6967458b21b7545717293810ab9c0ce Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Fri, 21 Nov 2008 14:20:19 +0000 Subject: [PATCH] Removing references to GDCM --- .../src/kernel/marGdcmDicom.cpp | 1060 ----------------- lib/maracasVisuLib/src/kernel/marGdcmDicom.h | 148 --- 2 files changed, 1208 deletions(-) delete mode 100644 lib/maracasVisuLib/src/kernel/marGdcmDicom.cpp delete mode 100644 lib/maracasVisuLib/src/kernel/marGdcmDicom.h diff --git a/lib/maracasVisuLib/src/kernel/marGdcmDicom.cpp b/lib/maracasVisuLib/src/kernel/marGdcmDicom.cpp deleted file mode 100644 index 796c8ef..0000000 --- a/lib/maracasVisuLib/src/kernel/marGdcmDicom.cpp +++ /dev/null @@ -1,1060 +0,0 @@ -/*========================================================================= - - Program: wxMaracas - Module: $RCSfile: marGdcmDicom.cpp,v $ - Language: C++ - Date: $Date: 2008/11/06 11:00:50 $ - Version: $Revision: 1.2 $ - - Copyright: (c) 2002, 2003 - License: - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -#ifdef _MSC_VER -#pragma warning ( disable : 4786 ) -#pragma warning ( disable : 4251 ) -#endif //_MSC_VER - - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include "vtkGdcmReader.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "marGdcmDicom.h" - - - -#include -#include -//using namespace std; - - - -#define _DICOMFILENAME "/DICOMDIR" - -//---------------------------------------------------------------------------- -// Callback for the interaction -class marProgressObserver : public vtkCommand -{ - public: - static marProgressObserver *New() - { return new marProgressObserver; } - marProgressObserver() - { - this->FrameGauge = NULL; - } - virtual void Execute(vtkObject *wdg, unsigned long event, void* calldata) - { - if ( this->FrameGauge ) - { - int val = this->FrameGauge->GetValue(); - this->FrameGauge->SetValue( val + 1); - //wxYield(); - //wxSafeYield(); - //wxYieldIfNeeded(); - //wxWakeUpIdle(); - //wxSafeYield( this->FrameGauge, FALSE); - } - } - wxGauge *FrameGauge; -}; -//---------------------------------------------------------------------------- -/* EED Borrame -static char* DicomTagsNames[] = { - "ID_File_Name", - "ID_SOP_Class_UID", //!0008 0016 UI ID SOP Class UID - "ID_SOP_Instance_UID", //!0008 0018 UI ID SOP Instance UID - "ID_Study_Date", //!0008 0020 DA ID Study Date - "ID_Series_Date", //!0008 0021 DA ID Series Date - "ID_Acquisition_Date", //!0008 0022 DA ID Acquisition Date - "ID_Image_Date", //!0008 0023 DA ID Image Date - "ID_Study_Time", //!0008 0030 TM ID Study Time - "ID_Series_Time", //!0008 0031 TM ID Series Time - "ID_Acquisition_Time", //!0008 0032 TM ID Acquisition Time - "ID_Image_Time", //!0008 0033 TM ID Image Time - "ID_Modality", //!0008 0060 CS ID Modality - "ID_Manufacturer", //!0008 0070 LO ID Manufacturer - "ID_Institution_Name", //!0008 0080 LO ID Institution Name - "ID_Study_Description", //!0008 1030 LO ID Study Description - "ID_Series_Description", //!0008 103e LO ID Series Description - "ID_Admitting_Diagnoses_Description", //!0008 1080 LO ID Admitting Diagnoses Description - "ID_Patient_Name", //!0010 0010 PN PAT Patient Name - "ID_Patient_ID", //!0010 0020 LO PAT Patient ID - "ID_Body_Part_Examined", //!0018 0015 CS ACQ Body Part Examined - "ID_Scanning_Sequence", //!0018 0020 CS ACQ Scanning Sequence - "ID_Sequence_Variant", //!0018 0021 CS ACQ Sequence Variant - "ID_Scan_Options", //!0018 0022 CS ACQ Scan Options - "ID_MR_Acquisition_Type", //!0018 0023 CS ACQ MR Acquisition Type - "ID_Sequence_Name", //!0018 0024 SH ACQ Sequence Name - "ID_Slice_Thickness", //!0018 0050 DS ACQ Slice Thickness - "ID_Repetition_Time", //!0018 0080 DS ACQ Repetition Time - "ID_Echo_Time", //!0018 0081 DS ACQ Echo Time - "ID_Inversion_Time", //!0018 0082 DS ACQ Inversion Time - "ID_Number_of_Averages", //!0018 0083 DS ACQ Number of Averages - "ID_Imaging_Frequency", //!0018 0084 DS ACQ Imaging Frequency - "ID_Imaged_Nucleus", //!0018 0085 SH ACQ Imaged Nucleus - "ID_Echo_Number", //!0018 0086 IS ACQ Echo Number - "ID_Magnetic_Field_Strength", //!0018 0087 DS ACQ Magnetic Field Strength - "ID_Spacing_Between_Slices", //!0018 0088 DS ACQ Spacing Between Slices - "ID_Echo_Train_Length", //!0018 0091 IS ACQ Echo Train Length - "ID_Percent_Sampling", //!0018 0093 DS ACQ Percent Sampling - "ID_Percent_Phase_Field_of_View", //!0018 0094 DS ACQ Percent Phase Field of View - "ID_Receiving_Coil", //!0018 1250 SH ACQ Receiving Coil - "ID_Patient_Position", //!0018 5100 CS ACQ Patient Position - "ID_Study_Instance_UID", //!0020 000d UI REL Study Instance UID - "ID_Series_Instance_UID", //!0020 000e UI REL Series Instance UID - "ID_Study_ID", //!0020 0010 SH REL Study ID - "ID_Series_Number", //!0020 0011 IS REL Series Number - "ID_Acquisition_Number", //!0020 0012 IS REL Acquisition Number - "ID_Image_Number", //!0020 0013 IS REL Image Number - "ID_Patient_Orientation", //!0020 0020 CS REL Patient Orientation - "ID_Image_Position", //!0020 0030 RET REL Image Position - "ID_Image_Position_Patient", //!0020 0032 DS REL Image Position Patient - "ID_Image_Orientation", //!0020 0035 RET REL Image Orientation - "ID_Image_Orientation_Patient", //!0020 0037 DS REL Image Orientation (Patient) - "ID_Location", //!0020 0050 RET REL Location - "ID_Frame_of_Reference_UID", //!0020 0052 UI REL Frame of Reference UID - "ID_Slice_Location", //!0020 1041 DS REL Slice Location - "ID_Image_Comments", //!0020 4000 LT REL Image Comments - "ID_Pixel_Spacing", //!0028 0030 DS IMG Pixel Spacing - "ID_Window_Center", //!0028 1050 DS IMG Window Center - "ID_Window_Width", //!0028 1051 DS IMG Window Width - "ID_Rescale_Intercept", //!0028 1052 CT IMG Rescale Intercept - "ID_Rescale_Slope", //!0028 1053 CT IMG Rescale Slope -}; - -*/ - -// ------------------------------------------------------------------------- -marGdcmDicom::marGdcmDicom( marParameters* p ) - : marFilesBase( p ){ - _dicomDir=NULL; - _iniSlice=-1; - _endSlice=-1; -//EED Borrame FillDicomInfo( ); -} - -/** Conversion de wxString en string. */ -//#define ws2s(as) (string(as.GetData())) - -/** Conversion de string en wxString. */ -//#define s2ws(s) (wxString((s).c_str())) - -/** Conversion de C-string en wxString. */ -//#define cs2ws(s) (wxString(s)) - -/* EED Borrame -// ------------------------------------------------------------------------- -wxArrayString marGdcmDicom::gdcmGetExamInfo( wxString directoryname ){ - - wxArrayString temparray; - temparray.Alloc( 60 ); - - wxDir dir(directoryname); - wxString filename; - bool cont = dir.GetFirst( &filename, "*", wxDIR_FILES ); - filename = directoryname + "/" + filename; - - std::string val; - - GDCM_NAME_SPACE::Header GdcmHeader( filename.c_str() ); - temparray.Add( filename ); // "ID_File_Name", - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0016).c_str() );// "ID_SOP_Class_UID", //0008 0016 UI ID SOP Class UID - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0018).c_str() );// "ID_SOP_Instance_UID", //0008 0018 UI ID SOP Instance UID - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0020).c_str() );// "ID_Study_Date", //0008 0020 DA ID Study Date - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0021).c_str() );// "ID_Series_Date", //0008 0021 DA ID Series Date - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0022).c_str() );// "ID_Acquisition_Date", //0008 0022 DA ID Acquisition Date - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0023).c_str() );// "ID_Image_Date", //0008 0023 DA ID Image Date - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0030).c_str() );// "ID_Study_Time", //0008 0030 TM ID Study Time - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0031).c_str() );// "ID_Series_Time", //0008 0031 TM ID Series Time - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0032).c_str() );// "ID_Acquisition_Time", //0008 0032 TM ID Acquisition Time - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0033).c_str() );// "ID_Image_Time", //0008 0033 TM ID Image Time - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0060).c_str() );// "ID_Modality", //0008 0060 CS ID Modality - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0070).c_str() );// "ID_Manufacturer", //0008 0070 LO ID Manufacturer - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x0080).c_str() );// "ID_Institution_Name", //0008 0080 LO ID Institution Name - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x1030).c_str() );// "ID_Study_Description", //0008 1030 LO ID Study Description - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x103e).c_str() );// "ID_Series_Description", //0008 103e LO ID Series Description - temparray.Add( GdcmHeader.GetEntryByNumber(0x0008,0x1080).c_str() );// "ID_Admitting_Diagnoses_Description", //0008 1080 LO ID Admitting Diagnoses Description - temparray.Add( GdcmHeader.GetEntryByNumber(0x0010,0x0010).c_str() );// "ID_Patient_Name", //0010 0010 PN PAT Patient Name - temparray.Add( GdcmHeader.GetEntryByNumber(0x0010,0x0020).c_str() );// "ID_Patient_ID", //0010 0020 LO PAT Patient ID - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0015).c_str() );// "ID_Body_Part_Examined", //0018 0015 CS ACQ Body Part Examined - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0020).c_str() );// "ID_Scanning_Sequence", //0018 0020 CS ACQ Scanning Sequence - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0021).c_str() );// "ID_Sequence_Variant", //0018 0021 CS ACQ Sequence Variant - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0022).c_str() );// "ID_Scan_Options", //0018 0022 CS ACQ Scan Options - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0023).c_str() );// "ID_MR_Acquisition_Type", //0018 0023 CS ACQ MR Acquisition Type - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0024).c_str() );// "ID_Sequence_Name", //0018 0024 SH ACQ Sequence Name - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0050).c_str() );// "ID_Slice_Thickness", //0018 0050 DS ACQ Slice Thickness - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0080).c_str() );// "ID_Repetition_Time", //0018 0080 DS ACQ Repetition Time - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0081).c_str() );// "ID_Echo_Time", //0018 0081 DS ACQ Echo Time - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0082).c_str() );// "ID_Inversion_Time", //0018 0082 DS ACQ Inversion Time - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0083).c_str() );// "ID_Number_of_Averages", //0018 0083 DS ACQ Number of Averages - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0084).c_str() );// "ID_Imaging_Frequency", //0018 0084 DS ACQ Imaging Frequency - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0085).c_str() );// "ID_Imaged_Nucleus", //0018 0085 SH ACQ Imaged Nucleus - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0086).c_str() );// "ID_Echo_Number", //0018 0086 IS ACQ Echo Number - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0087).c_str() );// "ID_Magnetic_Field_Strength", //0018 0087 DS ACQ Magnetic Field Strength - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0088).c_str() );// "ID_Spacing_Between_Slices", //0018 0088 DS ACQ Spacing Between Slices - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0091).c_str() );// "ID_Echo_Train_Length", //0018 0091 IS ACQ Echo Train Length - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0093).c_str() );// "ID_Percent_Sampling", //0018 0093 DS ACQ Percent Sampling - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x0094).c_str() );// "ID_Percent_Phase_Field_of_View", //0018 0094 DS ACQ Percent Phase Field of View - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x1250).c_str() );// "ID_Receiving_Coil", //0018 1250 SH ACQ Receiving Coil - temparray.Add( GdcmHeader.GetEntryByNumber(0x0018,0x5100).c_str() );// "ID_Patient_Position", //0018 5100 CS ACQ Patient Position - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x000d).c_str() );// "ID_Study_Instance_UID", //0020 000d UI REL Study Instance UID - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x000e).c_str() );// "ID_Series_Instance_UID", //0020 000e UI REL Series Instance UID - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x0010).c_str() );// "ID_Study_ID", //0020 0010 SH REL Study ID - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x0011).c_str() );// "ID_Series_Number", //0020 0011 IS REL Series Number - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x0012).c_str() );// "ID_Acquisition_Number", //0020 0012 IS REL Acquisition Number - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x0013).c_str() );// "ID_Image_Number", //0020 0013 IS REL Image Number - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x0020).c_str() );// "ID_Patient_Orientation", //0020 0020 CS REL Patient Orientation - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x0030).c_str() );// "ID_Image_Position", //0020 0030 RET REL Image Position - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x0032).c_str() );// "ID_Image_Position_Patient", //0020 0032 DS REL Image Position Patient - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x0035).c_str() );// "ID_Image_Orientation", //0020 0035 RET REL Image Orientation - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x0037).c_str() );// "ID_Image_Orientation_Patient", //0020 0037 DS REL Image Orientation (Patient) - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x0050).c_str() );// "ID_Location", //0020 0050 RET REL Location - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x0052).c_str() );// "ID_Frame_of_Reference_UID", //0020 0052 UI REL Frame of Reference UID - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x1041).c_str() );// "ID_Slice_Location", //0020 1041 DS REL Slice Location - temparray.Add( GdcmHeader.GetEntryByNumber(0x0020,0x4000).c_str() );// "ID_Image_Comments", //0020 4000 LT REL Image Comments - temparray.Add( GdcmHeader.GetEntryByNumber(0x0028,0x0030).c_str() );// "ID_Pixel_Spacing", //0028 0030 DS IMG Pixel Spacing - temparray.Add( GdcmHeader.GetEntryByNumber(0x0028,0x1050).c_str() );// "ID_Window_Center", //0028 1050 DS IMG Window Center - temparray.Add( GdcmHeader.GetEntryByNumber(0x0028,0x1051).c_str() );// "ID_Window_Width", //0028 1051 DS IMG Window Width - temparray.Add( GdcmHeader.GetEntryByNumber(0x0028,0x1052).c_str() );// "ID_Rescale_Intercept", //0028 1052 CT IMG Rescale Intercept - temparray.Add( GdcmHeader.GetEntryByNumber(0x0028,0x1053).c_str() );// "ID_Rescale_Slope", //0028 1053 CT IMG Rescale Slope - - return temparray; -} -*/ - -//#undef s2ws - - -// ---------------------------------------------------------------------------- -GDCM_NAME_SPACE::DicomDir* marGdcmDicom::getGdcmDicomDir() { - return _dicomDir; -} - - -// ---------------------------------------------------------------------------- -void marGdcmDicom::CreateDicomFile( ){ - wxString rootdir = getParameters( )->getStringParam( marParameters::e_dicom_images_directory ); -// EED Borrame GDCM_NAME_SPACE::DicomDir *tmp_dicomDir = new GDCM_NAME_SPACE::DicomDir( rootdir.c_str() , true ); - GDCM_NAME_SPACE::DicomDir *tmp_dicomDir = GDCM_NAME_SPACE::DicomDir::New(); - tmp_dicomDir->SetFileName( (const char*)(rootdir.mb_str()) ); - tmp_dicomDir->ParseDirectory(); - wxString strDicomDir(rootdir + wxString(_DICOMFILENAME, wxConvUTF8) ); - tmp_dicomDir->Write( (const char*)(strDicomDir.mb_str()) ); - tmp_dicomDir->Delete(); -} - -// ---------------------------------------------------------------------------- -void marGdcmDicom::FillDicomInfo(bool parseDir){ - reset(); - - wxString rootdir = getParameters( )->getStringParam( marParameters::e_dicom_images_directory ); - wxString strDICOMDIR( rootdir ); - if (parseDir==false){ - strDICOMDIR= strDICOMDIR + (wxChar)(_DICOMFILENAME); - } -//EED Borrame _dicomDir = new GDCM_NAME_SPACE::DicomDir( strDICOMDIR.c_str() , parseDir ); - _dicomDir = GDCM_NAME_SPACE::DicomDir::New(); - _dicomDir->SetFileName( (const char*)(strDICOMDIR.mb_str()) ); - if (parseDir==true){ - _dicomDir->ParseDirectory(); - } else { - _dicomDir->Load(); - } -} - -//------------------------------------------------------------------------- -void marGdcmDicom::setActualPatient(GDCM_NAME_SPACE::DicomDirPatient *patient){ - _actualPatient = patient; -} -//------------------------------------------------------------------------- -void marGdcmDicom::setActualStudy(GDCM_NAME_SPACE::DicomDirStudy *study){ - _actualStudy = study; -} -//------------------------------------------------------------------------- -void marGdcmDicom::setActualSerie(GDCM_NAME_SPACE::DicomDirSerie *serie){ - _actualSerie = serie; - setIniSlice(1); - GDCM_NAME_SPACE::DicomDirImage *im; - int numOfImg = 0; - im = serie->GetFirstImage(); - while ( im ) { // on degouline les Images de cette serie - numOfImg++; - im = serie->GetNextImage(); - } - setEndSlice( numOfImg ); -} -//------------------------------------------------------------------------- -void marGdcmDicom::setIniSlice(int iniSlice){ - _iniSlice=iniSlice; -} -//------------------------------------------------------------------------- -void marGdcmDicom::setEndSlice(int endSlice){ - _endSlice=endSlice; -} -//------------------------------------------------------------------------- -GDCM_NAME_SPACE::DicomDirSerie *marGdcmDicom::getActualSerie(){ - return _actualSerie; -} - -//------------------------------------------------------------------------- -GDCM_NAME_SPACE::DicomDirStudy* marGdcmDicom::getActualStudy(){ - return _actualStudy; -} - - -// ------------------------------------------------------------------------- -bool marGdcmDicom::SerieVerificationEqImageSize( GDCM_NAME_SPACE::FileList *gdcmFileList ){ - bool ok = true; - int ww = -1; - int hh = -1; - int wwBak = -1; - int hhBak = -1; - - int i; - for (i=(*gdcmFileList).size(); i<(*gdcmFileList).size() ; i++){ - GDCM_NAME_SPACE::File *gdcmFile = (GDCM_NAME_SPACE::File*)(*gdcmFileList)[i]; - - ww = gdcmFile->GetXSize(); - hh = gdcmFile->GetYSize(); - - if (wwBak!=-1){ - if (ww!=wwBak){ ok=false; } - } - wwBak=ww; - - if (hhBak!=-1){ - if (hh!=hhBak){ ok=false; } - } - hhBak=hh; - - } - - return ok; -} - - -/* -// ------------------------------------------------------------------------- -bool marGdcmDicom::SerieVerificationEqImageOrientation( gdcmPub::FileList *gdcmFileList ){ - bool ok = true; - float ox=-1,oy=-1,oz-1; - float oxBak=-99999,oyBak=-99999,ozBak=-99999; - gdcmPub::SerieHeader::GdcmHeaderList gdcmheaderlist = serieheader->GetGdcmFileList(); - -// gdcmPub::ListDicomDirImage::const_iterator itImage; -// itImage = (serie->GetDicomDirImages()).begin(); - - float iop[6]; - for ( gdcmPub::SerieHeader::GdcmHeaderList::const_iterator - it = gdcmheaderlist.begin(); - it != gdcmheaderlist.end(); ++it ){ - (*it)->GetImageOrientationPatient( iop ); - normal[0] = iop[1]*iop[5] - iop[2]*iop[4]; - normal[1] = iop[2]*iop[3] - iop[0]*iop[5]; - normal[2] = iop[0]*iop[4] - iop[1]*iop[3]; - - falta terminar esto ..... - - if (oxBak!=-99999){ - float rox,roy,roz; - prodouit_vectorial(ox,oy,oz , oxBak,oyBak,ozBak , &rox,&roy,&roz); - if ( (abs(rox)>0.000001) || (abs(roy)>0.000001) || (abs(roz)>0.000001)){ - ok=false; - } - } - oxBak=ox; - oyBak=oy; - ozBak=oz; - } - - // The same image orientation verification - while (itImage != serie->GetDicomDirImages().end() ) { // on degouline les SERIES de cette study - wxString strNum; - wxString strSub; - wxString strImgOriPat=(*itImage)->GetEntryByNumber(0x0020, 0x0037).c_str(); - double x1,y1,z1; - double x2,y2,z2; - if (strImgOriPat.Cmp( gdcmPub::GDCM_UNFOUND.c_str() )!=0){ - int pp; - strSub=strImgOriPat.Mid(0); - - pp=strSub.First('\'); - strNum=strSub.Mid(0, pp-1 ); - strNum.ToDouble(&x1); - strSub=strSub.Mid(pp+1); - - pp=strSub.First('\'); - strNum=strSub.Mid(0, pp-1 ); - strNum.ToDouble(&y1); - strSub=strSub.Mid(pp+1); - - pp=strSub.First('\'); - strNum=strSub.Mid(0, pp-1 ); - strNum.ToDouble(&z1); - strSub=strSub.Mid(pp+1); - - pp=strSub.First('\'); - strNum=strSub.Mid(0, pp-1 ); - strNum.ToDouble(&x2); - strSub=strSub.Mid(pp+1); - - pp=strSub.First('\'); - strNum=strSub.Mid(0, pp-1 ); - strNum.ToDouble(&y2); - strSub=strSub.Mid(pp+1); - - pp=strSub.First('\'); - strNum=strSub.Mid(0, pp-1 ); - strNum.ToDouble(&z2); - strSub=strSub.Mid(pp+1); - - normalize(&x1,&y1,&z1); - normalize(&x2,&y2,&z2); - prodouit_vectorial(x1,y1,z1 , x2,y2,z2 , &ox,&oy,&oz); - normalize(&ox,&oy,&oz); - if (oxBak!=-99999){ - double rox,roy,roz; - prodouit_vectorial(ox,oy,oz , oxBak,oyBak,ozBak , &rox,&roy,&roz); - if ( (abs(rox)>0.000001) || (abs(roy)>0.000001) || (abs(roz)>0.000001)){ - ok=false; - } - } - oxBak=ox; - oyBak=oy; - ozBak=oz; - } - ++itImage; - } // while - return ok; -} -// ------------------------------------------------------------------------- -*/ - - -bool marGdcmDicom::SerieVerification( GDCM_NAME_SPACE::FileList *gdcmFileList ){ - bool ok1=true; - bool ok2=true; - bool ok3=true; - ok1=SerieVerificationEqImageSize(gdcmFileList); -// ok2=SerieVerificationEqImageOrientation(gdcmFileList); -// ok3=SerieVerificationDifImagePositionPatient(gdcmFileList); - if (ok1==false){ - wxMessageDialog *msg = new wxMessageDialog(NULL, _T("The size of all images aren't the same."), _T("Warning"), wxOK ); - msg->ShowModal(); - delete msg; - } - return ok1 && ok2 && ok3; -} - - -// ------------------------------------------------------------------------- -void marGdcmDicom::CreateEmptyVoxel(){ - freeVolume(); - GDCM_NAME_SPACE::File *gdcmFile=_gdcmFileList[0]; - int wx = gdcmFile->GetXSize(); - int wy = gdcmFile->GetYSize(); - int wz = _gdcmFileList.size(); - - if (wx==0) - { - wx=1; - } - - double spx= (double)gdcmFile->GetXSpacing (); - double spy= (double)gdcmFile->GetYSpacing (); - double spz= (double)gdcmFile->GetZSpacing (); - kVolume *vol =new kVolume( kVolume::USHORT, wx, wy, wz,spx, spy, spz, malloc(sizeof(unsigned short)*wx*wy*wz ) ); - SetVolume( vol ); -} -// ------------------------------------------------------------------------- -void marGdcmDicom::PrepareLoadVolumeDispers(){ - CreateSerieHelper(); - CreateEmptyVoxel(); - ExtactSpacing(); - ExtactInterceptSlope(); -} - -//EED 7 mars 2007 -// ------------------------------------------------------------------------- -void marGdcmDicom::ExtactSpacing(){ - GDCM_NAME_SPACE::File *gdcmFile=_gdcmFileList[0]; - float sx = gdcmFile->GetXSpacing(); - float sy = gdcmFile->GetYSpacing(); -// float sz = gdcmFile->GetZSpacing(); - - - float xx1 = (_gdcmFileList[0])->GetXOrigin(); - float yy1 = (_gdcmFileList[0])->GetYOrigin(); - float zz1 = (_gdcmFileList[0])->GetZOrigin(); - - (_gdcmFileList[1])->Load(); - float xx2 = (_gdcmFileList[1])->GetXOrigin(); - float yy2 = (_gdcmFileList[1])->GetYOrigin(); - float zz2 = (_gdcmFileList[1])->GetZOrigin(); - - float xx=xx1-xx2; - float yy=yy1-yy2; - float zz=zz1-zz2; - - float sz=sqrt( xx*xx + yy*yy+ zz*zz ); - - getParameters( )->setDoubleParam( marParameters::e_voxel_x_dimension, sx ); - getParameters( )->setDoubleParam( marParameters::e_voxel_y_dimension, sy ); - getParameters( )->setDoubleParam( marParameters::e_voxel_z_dimension, sz ); -} -// ------------------------------------------------------------------------- -void marGdcmDicom::ExtactInterceptSlope(){ - GDCM_NAME_SPACE::File *gdcmFile=_gdcmFileList[0]; - float slope = gdcmFile->GetRescaleSlope(); - float intercept = gdcmFile->GetRescaleIntercept(); - getParameters( )->setDoubleParam( marParameters::e_RescaleIntercept , intercept ); - getParameters( )->setDoubleParam( marParameters::e_RescaleSlope , slope ); -} - - -// ------------------------------------------------------------------------- -bool marGdcmDicom::loadFileDicom(void* p_vol,int *dim,char *namefile) -{ - int dataSize; - GDCM_NAME_SPACE::File *gdcmFile = GDCM_NAME_SPACE::File::New(); -// gdcmFile->SetLoadMode(GDCM_NAME_SPACE::LD_NOSHADOW); - gdcmFile->SetFileName( namefile ); - bool ok = gdcmFile->Load(); - if (ok==true) - { - dataSize=sizeof(unsigned short)*dim[0]*dim[1]; - - bool manualLecture=false; - if ( (gdcmFile->GetTransferSyntaxName()=="Implicit VR - Little Endian") || - (gdcmFile->GetTransferSyntaxName()=="Explicit VR - Little Endian") || - (gdcmFile->GetTransferSyntaxName()=="Explicit VR - Big Endian") ) - { - manualLecture=true; - } - - if (manualLecture==true){ - long int offset = gdcmFile->GetPixelOffset(); - FILE *ff=fopen(namefile, "r" ); - fseek (ff,offset,SEEK_SET); - fread( (char*)p_vol , dataSize,1, ff); - fclose(ff); - - // gdcm/Dics/dicomTS.dic - // champ DICOM >> 0002|0010 - if (gdcmFile->GetTransferSyntaxName()=="Explicit VR - Big Endian") - { - int i; - char tmp; - char *pp=(char*)p_vol; - dataSize=dim[0]*dim[1]; - for (i=0;iGetImageDataRaw() , dataSize); - } - } - gdcmFile->Delete(); - return ok; -} -// ------------------------------------------------------------------------- - - -bool marGdcmDicom::loadImage(int i) -{ - - int dim[3]; - GDCM_NAME_SPACE::File *gdcmFileTEMP; - - gdcmFileTEMP = _gdcmFileList[i]; - vtkImageData *vol = getVolume( )->castVtk(); - void *p_vol=(void*)getVolume( )->castVtk()->GetScalarPointer(0,0,i); - vol->GetDimensions(dim); - bool ok=loadFileDicom( p_vol ,dim, (char *)gdcmFileTEMP->GetFileName().c_str() ); - -//EEDx44 - if (ok==false) { - char *ss = (char *)gdcmFileTEMP->GetFileName().c_str(); - _lstFileNotReaded.push_back( ss ); - } - - return ok; -} - -/* EED Borrame -// ------------------------------------------------------------------------- - -void marGdcmDicom::loadImage(int i) -{ - long int offset; - GDCM_NAME_SPACE::File *gdcmFileTEMP=_gdcmFileList[i]; - GDCM_NAME_SPACE::File *gdcmFile = GDCM_NAME_SPACE::File::New(); - gdcmFile->SetLoadMode(GDCM_NAME_SPACE::LD_NOSHADOW); - gdcmFile->SetFileName( gdcmFileTEMP->GetFileName().c_str() ); - bool ok = gdcmFile->Load(); - offset = gdcmFile->GetPixelOffset(); - gdcmFile->Delete(); - - std::ifstream infile; - FILE *ff=fopen(gdcmFileTEMP->GetFileName().c_str(), "r" ); - vtkImageData *vol = getVolume( )->castVtk(); - int dim[3]; - vol->GetDimensions(dim); - int US=sizeof(unsigned short); - int dataSize=US*dim[0]; - int y,sizeY=dim[1]; - for (y=0;yGetScalarPointer(0,y,i); - fread( (char*)p_vol , dataSize,1, ff); - offset=offset+dataSize; - } - fclose(ff); -} -*/ -// ------------------------------------------------------------------------- - -/* EED Borrame -void marGdcmDicom::loadImage(int i) -{ - - GDCM_NAME_SPACE::File *gdcmFileTEMP; - gdcmFileTEMP = _gdcmFileList[i]; - - - GDCM_NAME_SPACE::File *gdcmFile = GDCM_NAME_SPACE::File::New(); - gdcmFile->SetLoadMode(GDCM_NAME_SPACE::LD_NOSHADOW); - gdcmFile->SetFileName( gdcmFileTEMP->GetFileName().c_str() ); - bool ok = gdcmFile->Load(); - long int offset = gdcmFile->GetPixelOffset(); - gdcmFile->Delete(); - - std::ifstream infile; - infile.open( gdcmFileTEMP->GetFileName().c_str() , ifstream::in ); - if (infile.is_open()==true){ - vtkImageData *vol = getVolume( )->castVtk(); - void *p_vol = vol->GetScalarPointer(0,0,i); - int dim[3]; - vol->GetDimensions(dim); - int dataSize=2*dim[0]*dim[1]; - int US=sizeof(unsigned short); - char *temp=new char [dataSize]; - infile.seekg( 0 , ios_base::beg ); -// int a=infile.readsome( (char*)p_vol , dataSize ); -// int a=infile.readsome( temp , dataSize ); - - int length = 0; - while (infile.good()) - { - length += infile.readsome (temp,100); - } - - infile.close(); - } -} -*/ -// ------------------------------------------------------------------------- - - -/* EED Borrame - -void marGdcmDicom::loadImage(int i){ - vtkGdcmReader *gdcmReader = NULL; - - GDCM_NAME_SPACE::File *gdcmFile; - gdcmFile = _gdcmFileList[i]; - - - gdcmReader = vtkGdcmReader::New(); - const char *fileName = gdcmFile->GetFileName().c_str(); - gdcmReader->SetFileName( fileName ); - gdcmReader->UpdateWholeExtent(); - - //To simplyfy calculation later I turn Origin to (0, 0, 0) - //this shouldn't be 'trop grave' - vtkImageChangeInformation *change = vtkImageChangeInformation::New(); - - change->SetInput( gdcmReader->GetOutput() ); - change->SetOutputOrigin( 0, 0, 0); - - //Our algorithm are made based on unsigned short pixel/voxel: - //We need to cast our imagedata - vtkImageCast *cast = vtkImageCast::New(); - cast->SetInput( change->GetOutput() ); - cast->SetOutputScalarTypeToUnsignedShort(); - cast->Update(); //important - - - vtkImageData *imagedata = cast->GetOutput(); - vtkImageData *vol = getVolume( )->castVtk(); - - void *p_imagedata = imagedata->GetScalarPointer(0,0,0); - void *p_vol = vol->GetScalarPointer(0,0,i); - int dim[3]; - imagedata->GetDimensions(dim); - - memcpy( p_vol, p_imagedata , sizeof(unsigned short)*dim[0]*dim[1] ); - - //!\todo thanks - if(gdcmReader) gdcmReader->Delete(); - cast->Delete(); - change->Delete(); -} -*/ -// ------------------------------------------------------------------------- -void marGdcmDicom::Cleaning_gdcmFileList(){ - GDCM_NAME_SPACE::File *gdcmFile; - int i; - for (i=0; i<_gdcmFileList.size(); i++ ){ - gdcmFile=_gdcmFileList[i]; - gdcmFile->Delete(); - } - _gdcmFileList.clear(); -} - -// ------------------------------------------------------------------------- -void marGdcmDicom::CreateSerieHelper(){ // Virtual - wxString rootdir; - rootdir = getParameters( )->getStringParam( marParameters::e_dicom_images_directory ); - GDCM_NAME_SPACE::DicomDirImage *im; - -/* EED Borrame - _serieHelper = new GDCM_NAME_SPACE::SerieHelper(); - int iSlice=0; - im = _actualSerie->GetFirstImage(); - while ( im ) { // on degouline les Images de cette serie - iSlice++; - if ((iSlice>=_iniSlice) && (iSlice<=_endSlice)){ - wxString tmp( rootdir); - tmp=tmp+"/"; - tmp=tmp+im->GetEntryValue(0x0004, 0x1500).c_str(); // File name - _serieHelper->AddFileName( tmp.c_str() ); - _actualImage = im; - } - im = _actualSerie->GetNextImage(); - } - - _serieHelper->OrderGdcmFileList( _serieHelper->GetFirstCoherentFileList() ); -*/ - -/* EED Borrame - GDCM_NAME_SPACE::SerieHelper *serieHelper = new GDCM_NAME_SPACE::SerieHelper(); - int iSlice=0; - im = _actualSerie->GetFirstImage(); - while ( im ) { // on degouline les Images de cette serie - iSlice++; - if ((iSlice>=_iniSlice) && (iSlice<=_endSlice)){ - wxString tmp( rootdir); - tmp=tmp+"/"; - tmp=tmp+im->GetEntryValue(0x0004, 0x1500).c_str(); // File name - serieHelper->AddFileName( tmp.c_str() ); - _actualImage = im; - } - im = _actualSerie->GetNextImage(); - } - - GDCM_NAME_SPACE::GdcmFileList* tmpGdcmFileList=serieHelper->GetFirstCoherentFileList(); - serieHelper->OrderGdcmFileList( tmpGdcmFileList ); - for (int i=0; i size() ; i++){ - _gdcmFileList.push_back( (*tmpGdcmFileList)[i] ); - } -*/ - - - Cleaning_gdcmFileList(); - -/* - GDCM_NAME_SPACE::File *gdcmFile; - int iSlice=0; - im = _actualSerie->GetFirstImage(); - while ( im ) { // on degouline les Images de cette serie - if ((iSlice>=_iniSlice) && (iSlice<=_endSlice)){ - wxString fileName( rootdir); - fileName=fileName+"/"; - fileName=fileName+im->GetEntryString(0x0004, 0x1500).c_str(); // File name - - if (_gdcmFileList.size()==0){ -//EED Borrame gdcmFile = new GDCM_NAME_SPACE::File(fileName.c_str()); - gdcmFile = GDCM_NAME_SPACE::File::New(); - gdcmFile->SetFileName( fileName.c_str() ); - } else { - gdcmFile = GDCM_NAME_SPACE::File::New(); -//EED Borrame GDCM_NAME_SPACE::DocEntry *entry = im->GetFirstString(); - GDCM_NAME_SPACE::DocEntry *entry = im->GetFirstEntry(); - while (entry){ -//EED Borrame GDCM_NAME_SPACE::ValEntry *newEntry = new GDCM_NAME_SPACE::ValEntry(entry->GetDictEntry()); - GDCM_NAME_SPACE::DocEntry *newEntry = new GDCM_NAME_SPACE::DocEntry(); - - newEntry->Copy(entry); - gdcmFile->AddEntry(newEntry); - entry = im->GetNextEntry(); - } - gdcmFile->SetFileName( fileName.c_str() ); - } - _gdcmFileList.push_back(gdcmFile); - } - im = _actualSerie->GetNextImage(); - iSlice++; - } -*/ - - GDCM_NAME_SPACE::File *gdcmFile; - int iSlice=0; - im = _actualSerie->GetFirstImage(); - while ( im ) { // on degouline les Images de cette serie - if ((iSlice>=_iniSlice) && (iSlice<=_endSlice)){ - wxString fileName( rootdir); - fileName=fileName+_T("/"); - fileName=fileName + wxString(im->GetEntryString(0x0004, 0x1500).c_str(), wxConvUTF8); // File name - - gdcmFile = GDCM_NAME_SPACE::File::New(); - gdcmFile->SetFileName( (const char*)(fileName.mb_str()) ); - _gdcmFileList.push_back(gdcmFile); - } - im = _actualSerie->GetNextImage(); - iSlice++; - } - - - GDCM_NAME_SPACE::SerieHelper *serieHelper = GDCM_NAME_SPACE::SerieHelper::New(); - serieHelper->OrderFileList( &_gdcmFileList ); - delete serieHelper; - - if (getParameters( )->getInvestSliceOrder()==true){ - GDCM_NAME_SPACE::File *tmpGdcmFile; - int i,size=_gdcmFileList.size(); - for (i=0, size=_gdcmFileList.size()-1 ; i<=size; i++, size--){ - tmpGdcmFile=_gdcmFileList[i]; - _gdcmFileList[i]=_gdcmFileList[size]; - _gdcmFileList[size]=tmpGdcmFile; - } - } - - if ( !SerieVerification( &_gdcmFileList ) ){ - wxMessageDialog *msg = new wxMessageDialog(NULL, _T("This series doesn't look like a good series for Maracas.\nDo you want to continue?"), _T("Warning"), wxOK | wxCANCEL ); - msg->ShowModal(); - delete msg; - } - -} - -//------------------------------------------------------------------------- -void marGdcmDicom::loadActualSerie( wxGauge* gauge) -{ - loadVolume( true , gauge); -} - -// ------------------------------------------------------------------------- -void marGdcmDicom::loadVolume( bool force , wxGauge *gauge) -{ - - PrepareLoadVolumeDispers(); - loadImage(0); - -/* - int i; - int dim[3]; - vtkImageData *vol = getVolume( )->castVtk(); - vol->GetDimensions(dim); - for (i=0; iGetFirstCoherentFileList(); - gdcmReader = vtkGdcmReader::New(); - int i; - for ( i=0;isize();i++){ - gdcmFile = (*lstGdcmFile)[i]; - gdcmReader->AddFileName( gdcmFile->GetFileName().c_str() ); - } - gdcmReader->UpdateWholeExtent(); - gdcmReader->Update(); - } // fi - - marProgressObserver *progressEvent = marProgressObserver::New(); - progressEvent->FrameGauge = gauge; - //gdcmReader->AddObserver( vtkCommand::ProgressEvent, progressEvent); - progressEvent->Delete(); - - //To simplyfy calculation later I turn Origin to (0, 0, 0) - //this shouldn't be 'trop grave' - vtkImageChangeInformation *change = vtkImageChangeInformation::New(); - - change->SetInput( gdcmReader->GetOutput() ); - change->SetOutputOrigin( 0, 0, 0); - - //Our algorithm are made based on unsigned short pixel/voxel: - //We need to cast our imagedata - vtkImageCast *cast = vtkImageCast::New(); - cast->SetInput( change->GetOutput() ); - cast->SetOutputScalarTypeToUnsignedShort(); - cast->Update(); //important - - //FIXME: kVolume doesn't need to be -again- matrix rotated (done in vtkGdcmReader)!! - kVolume *volume = new kVolume( cast->GetOutput() ); - SetVolume(volume); - - //!\todo thanks - if(gdcmReader) gdcmReader->Delete(); - cast->Delete(); - change->Delete(); -*/ -} - -// ------------------------------------------------------------------------- -void marGdcmDicom::reset( ){ - freeVolume( ); - Cleaning_gdcmFileList(); - if(_dicomDir) { - _dicomDir->Delete(); - } - _dicomDir = NULL; -} - -// ------------------------------------------------------------------------- -wxString marGdcmDicom::GetPatientName(){ - GDCM_NAME_SPACE::File *gdcmFile=_gdcmFileList[0]; - return wxString( wxString(gdcmFile->GetEntryString(0x0010,0x0010).c_str(), wxConvUTF8) ).Trim();//0010 0010 PN PAT Patient Name -} - -// ------------------------------------------------------------------------- -void marGdcmDicom::copyFrom( const marObject& from ) -{ //!\todo TODO -} - -// ------------------------------------------------------------------------- -bool marGdcmDicom::save( std::ofstream& os ) -{ -/* int s = _actualStudy.length( ); - - os.write( ( const char* )&s, sizeof( int ) ); - os.write( ( char* )_actualStudy.c_str( ), s * sizeof( char ) ); - - s = _actualSerie.length( ); - - os.write( ( const char* )&s, sizeof( int ) ); - os.write( ( char* )_actualSerie.c_str( ), s * sizeof( char ) );*/ - - for(std::vector::iterator it1 = m_DicomInfo.begin(); - it1 != m_DicomInfo.end(); it1++ ) - { - for(std::vector::iterator it2 = it1->begin(); - it2 != it1->end(); it2++ ) - { - for(int i=0; iGetCount(); i++) - { - //wxString temp( it2->Item(i) ); - os << it2->Item(i); //temp; - } - } - } - - return( true ); -} - -// ------------------------------------------------------------------------- -bool marGdcmDicom::load( std::ifstream& is ) -{ -/* int s; - - reset( ); - - is.read( ( char* )&s, sizeof( int ) ); - _actualStudy.resize( s ); - is.read( ( char* )_actualStudy.c_str( ), s * sizeof( char ) ); - is.read( ( char* )&s, sizeof( int ) ); - _actualSerie.resize( s ); - is.read( ( char* )_actualSerie.c_str( ), s * sizeof( char ) );*/ - - for(std::vector::iterator it1 = m_DicomInfo.begin(); - it1 != m_DicomInfo.end(); it1++ ) - { - for(std::vector::iterator it2 = it1->begin(); - it2 != it1->end(); it2++ ) - { - for(int i=0; iGetCount(); i++) - { - std::string temp; - is >> temp ; - it2->Add( wxString(temp.c_str(), wxConvUTF8) ); - } - } - } - - return( true ); -} - - -// ------------------------------------------------------------------------- -// ------------------------------------------------------------------------- -// ------------------------------------------------------------------------- - -marGdcmDicomILPD::marGdcmDicomILPD( marParameters* p ) -: marGdcmDicom(p) -{ -} -// ------------------------------------------------------------------------- -void marGdcmDicomILPD::CreateSerieHelper() -{ - GDCM_NAME_SPACE::File *gdcmFile; - Cleaning_gdcmFileList(); - int i,max=_lstString.size(); - for (i=0;iSetLoadMode(GDCM_NAME_SPACE::LD_ALL); - gdcmFile->SetFileName( _lstString[i] -> c_str() ); - /*bool ok = */ gdcmFile->Load(); - } else { - gdcmFile = GDCM_NAME_SPACE::File::New(); - gdcmFile->SetFileName( _lstString[i] -> c_str() ); - } - _gdcmFileList.push_back(gdcmFile); - } - -} -// ------------------------------------------------------------------------- - - - - - diff --git a/lib/maracasVisuLib/src/kernel/marGdcmDicom.h b/lib/maracasVisuLib/src/kernel/marGdcmDicom.h deleted file mode 100644 index 7d3b493..0000000 --- a/lib/maracasVisuLib/src/kernel/marGdcmDicom.h +++ /dev/null @@ -1,148 +0,0 @@ -/*========================================================================= - - Program: wxMaracas - Module: $RCSfile: marGdcmDicom.h,v $ - Language: C++ - Date: $Date: 2008/10/31 16:32:55 $ - Version: $Revision: 1.1 $ - - Copyright: (c) 2002, 2003 - License: - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -#ifndef __MAR__KERNEL__MARGDCMDICOM__HXX__ -#define __MAR__KERNEL__MARGDCMDICOM__HXX__ - -#include -#include - -#include -#include - - - -#include "gdcmDicomDir.h" -#include "gdcmSerieHelper.h" -#include "gdcmDicomDirPatient.h" -#include "gdcmDicomDirStudy.h" -#include "gdcmDicomDirSerie.h" -#include "gdcmDicomDirImage.h" -#include "marDicomBase.h" - - - - - -typedef std::vector SerieInfo; //DICOM info for each serie -/** - * Shouldn't we break the dependencies to wx ??? - * - * We use vector instead of list for efficiency: for access time - * futhermore the number of patient is not changing a lot, so we - * might add the number of patient to params.dat, to allocate the right - * number of vector - * - */ - -// EED -// class MAR_KERNEL_EXPORT marGdcmDicom : public marObject - - -class marGdcmDicom : public marFilesBase -{ - public: - - marGdcmDicom( marParameters* p = NULL ); - - ~marGdcmDicom( ){ - reset( ); - } - - void loadActualSerie(wxGauge* gauge ); - void loadVolume( bool force = false, wxGauge* gauge = NULL); - void PrepareLoadVolumeDispers(); - virtual bool loadImage(int i); - bool loadFileDicom(void* p_vol,int *dim,char *namefile); - - - /** - * General methods - */ - void reset( ); - void Cleaning_gdcmFileList(); - - void copyFrom( const marObject& from ); - /** - * Persistence methods - */ - bool save( std::ofstream& os ); - bool load( std::ifstream& is ); - - void CreateDicomFile( ); - void FillDicomInfo(bool parseDir); - - wxString GetPatientName(); - - GDCM_NAME_SPACE::DicomDir* getGdcmDicomDir(); - - GDCM_NAME_SPACE::DicomDirStudy* getActualStudy(); - - void setActualPatient(GDCM_NAME_SPACE::DicomDirPatient *patient); - void setActualStudy(GDCM_NAME_SPACE::DicomDirStudy *study); - void setActualSerie(GDCM_NAME_SPACE::DicomDirSerie *serie); - - void setIniSlice(int iniSlice); - void setEndSlice(int endSlice); - - GDCM_NAME_SPACE::DicomDirSerie *getActualSerie(); - - - private: - - - std::vector< SerieInfo > m_DicomInfo; - GDCM_NAME_SPACE::DicomDir *_dicomDir; - GDCM_NAME_SPACE::DicomDirPatient *_actualPatient; - GDCM_NAME_SPACE::DicomDirStudy *_actualStudy; - GDCM_NAME_SPACE::DicomDirSerie *_actualSerie; - GDCM_NAME_SPACE::DicomDirImage *_actualImage; - - int _iniSlice; - int _endSlice; - - virtual void CreateSerieHelper(); - void CreateEmptyVoxel(); - void ExtactSpacing(); - void ExtactInterceptSlope(); - - bool SerieVerification( GDCM_NAME_SPACE::FileList *gdcmFileList ); - bool SerieVerificationEqImageSize( GDCM_NAME_SPACE::FileList *gdcmFileList ); -// bool SerieVerificationEqImageOrientation( GDCM_NAME_SPACE::GdcmFileList *gdcmFileList ); - - - - protected: - GDCM_NAME_SPACE::FileList _gdcmFileList; - -}; - - -//------------------------------------------------------------------- - -class marGdcmDicomILPD : public marGdcmDicom -{ -public: - marGdcmDicomILPD( marParameters* p = NULL ); -private: - virtual void CreateSerieHelper(); -protected: -}; - -//------------------------------------------------------------------- - -#endif // __MAR__KERNEL__MARGDCMDICOM__HXX__ -- 2.47.1