X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvQDicomSeriesSelector.cxx;h=d5444cdbe5b168317880b97895b8f741f7379045;hb=502d2827b43310d71e16e5237216af8e62f0dcf4;hp=48397bc191994b5ba91f0a8d7b4c2249e06f0c1e;hpb=c8d3aefe3d07dd6f7092db662ca1b5d85553d544;p=clitk.git diff --git a/vv/vvQDicomSeriesSelector.cxx b/vv/vvQDicomSeriesSelector.cxx index 48397bc..d5444cd 100644 --- a/vv/vvQDicomSeriesSelector.cxx +++ b/vv/vvQDicomSeriesSelector.cxx @@ -20,7 +20,7 @@ #include #include #include -#if GDCM_MAJOR_VERSION == 2 +#if GDCM_MAJOR_VERSION >= 2 #include #include #include @@ -58,6 +58,8 @@ vvDicomSeriesSelector::vvDicomSeriesSelector(QWidget* parent) this, SLOT(itemSelectionChanged())); connect(ui.mDicomDetailsListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(itemDetailsSelectionChanged())); + connect(ui.mIsMatrixCheckBox, SIGNAL(stateChanged(int)), + this, SLOT(itemMatrixSelectionChanged(int))); // Initialization /* if (config::get_current_path() != QString(0)) @@ -67,6 +69,8 @@ vvDicomSeriesSelector::vvDicomSeriesSelector(QWidget* parent) mPreviousPath = mFoldername; ui.mFolderLineEdit->setText(mFoldername); + ui.mIsMatrixCheckBox->setChecked(0); + mPatientCoordinateSystem = false; // ui.mTableWidget->setRowCount(0); } //==================================================================== @@ -94,8 +98,12 @@ void vvDicomSeriesSelector::close() void vvDicomSeriesSelector::BrowseButtonRelease() { QFileDialog dialog(this); + QStringList filters; + filters << "DICOM files (*.dcm)" + << "All files (*)"; dialog.setFileMode(QFileDialog::AnyFile); - dialog.setFilter("DICOM files (*.dcm); All files (*)"); + dialog.setNameFilters(filters); + //dialog.setFilter(tr("DICOM files (*.dcm); All files (*)")); mFoldername = dialog.getExistingDirectory(this, "Select a folder to find DICOM image", mPreviousPath); @@ -136,7 +144,7 @@ void vvDicomSeriesSelector::SearchButtonRelease() mListOfSeriesFilenames[seriesUID[i]] = filenames; // store first header -#if GDCM_MAJOR_VERSION == 2 +#if GDCM_MAJOR_VERSION >= 2 mDicomHeader[seriesUID[i]].SetFileName( (*filenames)[0].c_str() ); mDicomHeader[seriesUID[i]].Read(); #else @@ -227,7 +235,7 @@ void vvDicomSeriesSelector::itemDetailsSelectionChanged() std::ostringstream s; QString l; -#if GDCM_MAJOR_VERSION == 2 +#if GDCM_MAJOR_VERSION >= 2 mDicomHeader[mCurrentSerie].GetFile().Print(s); const gdcm::File& header = mDicomHeader[mCurrentSerie].GetFile(); gdcm::StringFilter sf; @@ -276,7 +284,7 @@ void vvDicomSeriesSelector::itemDetailsSelectionChanged() //==================================================================== //==================================================================== -#if GDCM_MAJOR_VERSION == 2 +#if GDCM_MAJOR_VERSION >= 2 QString vvDicomSeriesSelector::MakeDicomInfo(std::string & s, const gdcm::Reader& header) { QString n = QString("%1").arg(mListOfSeriesFilenames[s]->size()); @@ -315,7 +323,6 @@ QString vvDicomSeriesSelector::MakeDicomInfo(std::string & s, const gdcm::Reader #else QString vvDicomSeriesSelector::MakeDicomInfo(std::string & s, gdcm::File *header) { - setlocale(LC_NUMERIC, "POSIX"); QString n = QString("%1").arg(mListOfSeriesFilenames[s]->size()); QString size = QString("%1x%2x%3") .arg(header->GetXSize()) @@ -350,7 +357,7 @@ QString vvDicomSeriesSelector::MakeDicomInfo(std::string & s, gdcm::File *header //==================================================================== QString vvDicomSeriesSelector::AddInfo(const gdcm::File *header, QString n, uint16_t group, uint16_t elem) { -#if GDCM_MAJOR_VERSION == 2 +#if GDCM_MAJOR_VERSION >= 2 gdcm::StringFilter sf; sf.SetFile( *header ); gdcm::Tag t( group, elem ); @@ -374,7 +381,7 @@ QString vvDicomSeriesSelector::AddInfo(std::string n, std::string m) //==================================================================== void vvDicomSeriesSelector::AddSerieToTheTable(int i, std::vector & filenames) { -#if GDCM_MAJOR_VERSION == 2 +#if GDCM_MAJOR_VERSION >= 2 #else gdcm::File *header = new gdcm::File(); header->SetFileName(filenames[0]); @@ -398,4 +405,13 @@ void vvDicomSeriesSelector::AddSerieToTheTable(int i, std::vector & } //==================================================================== + +//==================================================================== +void vvDicomSeriesSelector::itemMatrixSelectionChanged(int state) +{ + mPatientCoordinateSystem = state; +} +//==================================================================== + + #endif // VVDICOMSERIESSELECTOR_CXX