vvSurfaceViewerDialog.cxx
vvMainWindowBase.cxx
vvMainWindow.cxx
+ vvProgressDialog.cxx
vvDeformationDialog.cxx
vvImageWarp.cxx
vvDeformableRegistration.cxx
vvMidPosition.cxx
vvImageMapToWLColors.cxx
vvIntensityValueSlider.cxx
+ vvThreadedFilter.cxx
vvToolManager.cxx
vvToolCreatorBase.cxx
vvToolWidgetBase.cxx
vvSlicerManager.h
vvStructSelector.h
vvIntensityValueSlider.h
+ vvThreadedFilter.h
vvToolCreatorBase.h
# vvToolFoo.h
# vvToolFooWithWidgetBase.h
qt_ui/vvStructSelector.ui
qt_ui/vvDummyWindow.ui #For testing
qt_ui/vvIntensityValueSlider.ui
- qt_ui/vvToolSimpleInputSelectorWidget.ui
+# qt_ui/vvToolSimpleInputSelectorWidget.ui
qt_ui/vvToolInputSelectorWidget.ui
qt_ui/vvToolWidgetBase.ui
# qt_ui/vvToolWidgetWithStepsBase.ui
std::vector<std::string> filenames;
std::vector<std::pair<int ,std::string> > overlays;
+ std::vector<std::pair<int ,std::string> > rois;
std::vector<std::pair<int ,std::string> > vector_fields;
if (argc >1) {
for (int i = 1; i < argc; i++) {
assert(filenames.size()>=1);
vector_fields.push_back(std::make_pair(filenames.size()-1,argv[i+1]));
i++; //skip vf name
- } else if (temp=="--overlay") {
- assert(filenames.size()>=1);
- overlays.push_back(std::make_pair(filenames.size()-1,argv[i+1]));
- i++; //skip overlay name
- } else
- filenames.push_back(temp);
+ }
+ else {
+ if (temp=="--overlay") {
+ assert(filenames.size()>=1);
+ overlays.push_back(std::make_pair(filenames.size()-1,argv[i+1]));
+ i++; //skip overlay name
+ }
+ else {
+ if (temp=="--roi") {
+ assert(filenames.size()>=1);
+ rois.push_back(std::make_pair(filenames.size()-1,argv[i+1]));
+ i++; //skip overlay name
+ }
+ else {
+ filenames.push_back(temp);
+ }
+ }
+ }
}
window.LoadImages(filenames,IMAGE);
for (std::vector<std::pair<int ,std::string> >::iterator i=overlays.begin();
for (std::vector<std::pair<int ,std::string> >::iterator i=vector_fields.begin();
i!=vector_fields.end(); i++)
window.AddField((*i).second.c_str(), (*i).first);
+ for (std::vector<std::pair<int ,std::string> >::iterator i=rois.begin();
+ i!=rois.end(); i++) {
+ DD((*i).second.c_str());
+ DD((*i).first);
+ // window.AddROI((*i).second.c_str(), (*i).first);
+ }
}
- BSD See included LICENSE.txt file
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
======================================================================-====*/
+
#ifndef VVTOOLINPUTSELECTORWIDGET_CXX
#define VVTOOLINPUTSELECTORWIDGET_CXX
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvLabelImageLoaderWidget::SetText(QString t)
+{
+ mOpenLabel->setText(t);
+}
+//------------------------------------------------------------------------------
+
+
//------------------------------------------------------------------------------
void vvLabelImageLoaderWidget::OpenImage()
{
- BSD See included LICENSE.txt file
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
======================================================================-====*/
+
#ifndef VVLABELIMAGELOADERWIDGET_H
#define VVLABELIMAGELOADERWIDGET_H
vvImage::Pointer GetImage();
double GetBackgroundValue();
+ void SetText(QString t);
signals:
void accepted();
//open images as 1 or multiples
for (int i = 0; i < fileSize; i++) {
- progress.Update("Opening " + files[i]);
+ progress.SetText("Opening " + files[i]);
progress.SetProgress(i,fileSize);
qApp->processEvents();
- BSD See included LICENSE.txt file
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
======================================================================-====*/
-#ifndef vvProgressDialog_h
-#define vvProgressDialog_h
+
+#ifndef VVPROGRESSDIALOG_H
+#define VVPROGRESSDIALOG_H
+
+// vv
#include "ui_vvProgressDialog.h"
-#include <string>
-class vvProgressDialog : public QDialog, private Ui::vvProgressDialog
+class vvProgressDialog :
+ public QDialog,
+ private Ui::vvProgressDialog
{
Q_OBJECT
public:
- vvProgressDialog(std::string message,bool show_progress=false) {
- setupUi(this);
- textLabel->setText(message.c_str());
- if (show_progress)
- progressBar->show();
- else
- progressBar->hide();
- this->show();
- }
- void Update(std::string message)
- {
- textLabel->setText(message.c_str());
- }
- void SetProgress(unsigned int current,unsigned int max)
- {
- progressBar->setMaximum(max);
- progressBar->setValue(current);
- }
+ vvProgressDialog(std::string message,bool show_progress=false);
~vvProgressDialog() {}
-
-public slots:
-
+ void SetText(std::string message);
+ void AddToText(std::string message);
+ void SetProgress(unsigned int current,unsigned int max);
};
#endif
#include "vvImageReader.h"
#include "vvImageWriter.h"
#include "vvLabelImageLoaderWidget.h"
-#include "vvProgressDialog.h"
+#include "vvThreadedFilter.h"
// Qt
#include <QMessageBox>
Ui_vvToolExtractLung::setupUi(mToolWidget);
mMaskLoaderBox->setEnabled(false);
mOptionsBox->setEnabled(false);
+ mPatientMaskInputWidget->SetText("Patient mask");
connect(mPatientMaskInputWidget, SIGNAL(accepted()), this, SLOT(PatientMaskInputIsSelected()));
// Default values
mFilter = FilterType::New();
// Add input selector
- AddInputSelector("Select image", mFilter);
+ AddInputSelector("Select CT thorax image", mFilter);
}
//------------------------------------------------------------------------------
mFilter->SetArgsInfo(mArgsInfo);
DD("mfilter->Update");
- // vvThreadedFilter a;
- // a->SetFilter(mFilter)
+ vvThreadedFilter thread;
+ // thread.SetFilter((clitk::FilterBase*)&(*mFilter));
+ // thread.SetFilter((clitk::FilterBase*)&(*mFilter));
+ thread.SetFilter(&(*mFilter));
// connect(a, SIGNAL(rejected()), this, SLOT(FilterHasBeenCanceled()));
- // a->Update();
+ thread.Update();
// if (a->HasError()) { DD(a->GetError()); return; }
- mFilter->Update();
+ // mFilter->Update();
+ DD("after thread");
// Check error
if (mFilter->HasError()) {
std::vector<vvImage::Pointer> output = mFilter->GetOutputVVImages();
DD(output.size());
+ if (output.size() == 0) {
+ std::cerr << "Error : no output ?" << std::endl;
+ close();
+ return;
+ }
+
// Set Lung into VV
DD("lung");
vvImage::Pointer lung = output[0];
======================================================================-====*/
#ifndef VVTOOLINPUTSELECTORWIDGET_CXX
#define VVTOOLINPUTSELECTORWIDGET_CXX
+
#include "vvToolSimpleInputSelectorWidget.h"
#include "vvToolInputSelectorWidget.h"
#include "vvSlicerManager.h"
*/
// Get warped output and display it
- m_WarpedImage = vvImageFromITK<3, float>(m_WarpedImageITK);
- std::ostringstream osstream;
- osstream << "plm_warped_" << m_InputSlicerManagers[1]->GetFileName() << ".mhd";
- AddImage(m_WarpedImage, osstream.str());
-
- // Get DVF
- DD("TODO get and display DVF");
+ if (m_WarpedImageITK) {
+ m_WarpedImage = vvImageFromITK<3, float>(m_WarpedImageITK);
+ std::ostringstream osstream;
+ osstream << "plm_warped_" << m_InputSlicerManagers[1]->GetFileName() << ".mhd";
+ AddImage(m_WarpedImage, osstream.str());
+
+ // Get DVF
+ DD("TODO get and display DVF");
+ }
+ else {
+ QMessageBox::information(this, "Error", "No result ...");
+ }
// End
QApplication::restoreOverrideCursor();
- BSD See included LICENSE.txt file
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
======================================================================-====*/
+
+// vv
#include "vvToolRigidReg.h"
-#include <QComboBox>
-#include <QCursor>
-#include <QApplication>
+#include "vvImageReader.h"
+#include "vvSlicer.h"
+
+// vtk
#include <vtkImageData.h>
#include <vtkSmartPointer.h>
#include <vtkTransform.h>
-#include <vvImageReader.h>
-#include "vvImage.h"
-#include "vvSlicer.h"
-#include <QFile>
+
+// clitk
#include "clitkTransformUtilities.h"
-#include <QString>
+
+// qt
#include <QMessageBox>
-#include <vvMainWindow.h>
#include <QFileDialog>
#include <QTextStream>
+#include <QComboBox>
+#include <QCursor>
+
//------------------------------------------------------------------------------
// Create the tool and automagically (I like this word) insert it in
// the main window menu.
{
// GUI Initialization
Ui_vvToolRigidReg::setupUi(mToolWidget);
- QSize qsize;
- qsize.setHeight(470);
- qsize.setWidth(850);
- mToolWidget->setFixedSize(qsize);
+ // QSize qsize;
+// qsize.setHeight(470);
+// qsize.setWidth(850);
+// mToolWidget->setFixedSize(qsize);
// Set how many inputs are needed for this tool
{
//Write the Transformation Matrix
QString f1 = QFileDialog::getSaveFileName(this, tr("Save Transformation Matrix File"),
- "/home",
- tr("Text (*.mat *.txt *.doc *.rtf)"));
+ mMainWindow->GetInputPathName(),
+ tr("Text (*.mat *.txt *.doc *.rtf)"));
QFile file1(f1);
std::vector<QString> transparameters;
QString line1;
QString file1 = QFileDialog::getOpenFileName(
this,
"Choose the Transformation Parameters file",
- "/home",
+ mMainWindow->GetInputPathName(),
"Text (*.mat *.txt *.rtf *.doc)");
if (file1.isEmpty())
return;
}
}
if (mSlicerManagersCompatible.size() == 0) {
- QMessageBox::information(this, "No image","Sorry, could not perform operation. No (compatible) image.");
+ std::ostringstream osstream;
+ osstream << "Sorry, could not perform operation. No (compatible) image. "
+ << mFilter->GetAvailableImageTypes();
+ QMessageBox::information(this, "No image", osstream.str().c_str());
reject();
return;
}
bool vvToolWidgetBase::close()
{
// DD("vvToolWidgetBase::close()");
+ QApplication::restoreOverrideCursor();
return QWidget::close();
}
//------------------------------------------------------------------------------