39 #include "qinputdialog.h"
45 #include "itkImageFileReader.h"
47 #include "vtkImageReader2Factory.h"
48 #include "vtkImageReader2.h"
49 #include "vtkImageData.h"
112 synchronizedView->
show();
115 return synchronizedView;
162 tr(
"Select Image"),
"",
163 tr(
"Images (*.png *.bmp *.jpg *.jpeg *.tiff *.mha *.mhd *.img *.lsm)") );
183 vtkImageReader2Factory *r_factory = vtkImageReader2Factory::New();
184 vtkImageReader2 * reader =
185 r_factory->CreateImageReader2( iFile.
toAscii().
data() );
190 vtkImageData *image = reader->GetOutput();
206 tr(
"Select Image"),
"",
207 tr(
"Images (*.png *.bmp *.jpg *.jpeg *.tiff)")
228 std::cerr <<
"QGoSynchronizedViewMainWindow::SaveSnapshotInFile incorrect name of file" << std::endl;
233 std::cout << nameOfScreenshot.
toStdString() << std::endl;
235 if ( ( extension.
contains(
"jpg", Qt::CaseInsensitive) )
236 || ( extension.
contains(
"jpeg", Qt::CaseInsensitive) ) )
242 if ( extension.
contains(
"bmp", Qt::CaseInsensitive) )
248 if ( extension.
contains(
"png", Qt::CaseInsensitive) )
254 if ( extension.
contains(
"eps", Qt::CaseInsensitive) )
260 if ( extension.
contains(
"tiff", Qt::CaseInsensitive) )
266 std::cerr <<
"QGoSynchronizedViewMainWindow::SaveSnapshotInFile couldn't find appropriate extension"
275 if ( SynchronizedView != 0 )
307 std::cerr <<
"QGoSynchronizedViewMainWindow::SaveSnapshotInFile can't access fullscreen view" << std::endl;
320 std::cerr <<
"QGoSynchronizedViewMainWindow::SaveSnapshotInFile synchronizedView pointer error" << std::endl;
328 std::stringstream timageinfo;
346 tr(
"Synchronize open images for point-to-point comparison") );
353 tr(
"Synchronize open images for point-to-point comparison") );
421 tr(
"About QGoCompare"),
422 tr(
"<b>QGoCompare</b> lets you open multiple"
423 " VTK/ITK images from a"
424 " VTK or ITK pipeline and compare them."
426 " Qt, VTK, ITK and GoFigure2 libraries") );
433 tr(
"About GoFigure2"),
434 tr(
"<b>GoFigure2</b> is a cross-platform,"
435 " free open source software (FOSS), for"
436 " visualizing, processing and analysing of bioimages"
437 " http://gofigure2.sourceforge.net/") );
452 bool has3DSynchronizedView = ( ( hasSynchronizedView )
477 tr(
"&Open an image file"),
this);
481 SIGNAL( triggered() ),
497 tr(
"Synchronize open images for point-to-point comparison") );
499 SIGNAL( triggered() ),
507 SIGNAL( triggered() ),
513 #if ( ( QT_MAJOR_VERSION == 4 ) && ( QT_MINOR_VERSION >= 6 ) )
518 SIGNAL( triggered() ),
520 SLOT( closeAllWindows() ) );
526 SIGNAL( triggered() ),
528 SLOT( closeActiveSubWindow() ) );
533 SIGNAL( triggered() ),
535 SLOT( closeAllSubWindows() ) );
540 SIGNAL( triggered() ),
542 SLOT( tileSubWindows() ) );
547 SIGNAL( triggered() ),
549 SLOT( cascadeSubWindows() ) );
554 SIGNAL( triggered() ),
561 SIGNAL( triggered() ),
568 SIGNAL( triggered() ),
575 SIGNAL( triggered() ),
582 SIGNAL( triggered() ),
589 SIGNAL( triggered() ),
596 SIGNAL( triggered() ),
603 SIGNAL( triggered() ),
668 if ( SynchronizedView->
GetName() == iSynchronizedViewName )
void setText(const QString &text)
std::string toStdString() const
void addToolBar(Qt::ToolBarArea area, QToolBar *toolbar)
QString * GetName(void)
get SynchronizedView's name
void setActiveSubWindow(QWidget *window)
abstract class for QGoSynchronizedView2D and QGoSynchronizedView3D. Those classes are used to display...
class used to display a QWidget containing a two dimensional a vtkimagedata* or an itkimage*...
QMenuBar * menuBar() const
QGoSynchronizedViewManager * GetSynchronizedViewManager()
void showMessage(const QString &message, int timeout)
void about(QWidget *parent, const QString &title, const QString &text)
QStatusBar * statusBar() const
QGoSynchronizedViewMainWindow()
bool isSynchronizing()
true if the manager synchronizes some QGoSynchronizedView
void show()
show all the QGoSynchronizedView s
void Update()
update the QGoSynchronizedView s
void closeAllSubWindows()
QGoSynchronizedViewManager * m_SynchronizedViewManager
QMdiSubWindow * activeSubWindow() const
void deleteSynchronizedView2D(const int &iId)
QString tr(const char *sourceText, const char *disambiguation, int n)
QString SnapshotViewXY(const GoFigure::FileType &iType, const QString &iBaseName=tr("Snapshot"))
Save a screenshot of the viewer's content.
void setActiveSubWindow(QMdiSubWindow *window)
void setUnifiedTitleAndToolBarOnMac(bool set)
QString fromStdString(const std::string &str)
void setShortcuts(const QList< QKeySequence > &shortcuts)
QString SnapshotViewXYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xyz-"))
void synchronizeOpenSynchronizedViews()
synchronize all open QGoSynchronizedViews
virtual void PrintOs(ostream &os)=0
print the SynchronizedView information : it consists in the image information if any.
QString SnapshotViewYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-yz-"))
QMdiSubWindow * addSubWindow(QWidget *widget, QFlags< Qt::WindowType > windowFlags)
void setCentralWidget(QWidget *widget)
void deleteSynchronizedView3D(const int &iId)
void closeEvent(QCloseEvent *event)
void OpenSynchronizedViewForFile(QString &iFile)
QList< QMdiSubWindow * > subWindowList(WindowOrder order) const
void deleteSynchronizedView3D(QGoSynchronizedView3D *ioSynchronizedView)
bool contains(QChar ch, Qt::CaseSensitivity cs) const
class used to display a QWidget containing a two dimensional vtkimagedata* or itkimage*. QGoSynchronizedView3D provide the interface to synchronize cameras among several GoSynchronizedView3D.
void setStatusTip(const QString &statusTip)
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
High level class for QGoSynchronizedView2D, QGoSynchronizedView2DCallbacks QGoSynchronizedView3D, QGoSynchronizedView3DCallbacks.
QMdiSubWindow * findSynchronizedView(const QString &iSynchronizedViewName)
QString section(QChar sep, int start, int end, QFlags< QString::SectionFlag > flags) const
QSignalMapper * windowMapper
QString SnapshotViewXY(const GoFigure::FileType &iType, const QString &iBaseName=tr("Snapshot-xy-"))
void deleteSynchronizedView2D(QGoSynchronizedView2D *ioSynchronizedView)
delete a QGoSynchronizedView from QGoSynchronizedViewManager's parent Object/Widget delete the QGoSyn...
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
void SaveSnapshotInFile(QString &iFile, QGoSynchronizedView *SynchronizedView)
virtual int GetSynchronizedViewType(void)=0
returns the type of SynchronizedView (2 for 2D, 3 for 3D)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void unSynchronizeOpenSynchronizedViews()
remove the synchronization leaving the all QGoSynchronizedView independent
QGoSynchronizedView * activeSynchronizedView()
~QGoSynchronizedViewMainWindow()
QGoSynchronizedView3D * newSynchronizedView(QString iSynchronizedViewName, typename itk::Image< TPixel, 3 >::Pointer iImage)
create and add a QGoSynchronizedView to QGoSynchronizedViewManager's parent Object/Widget ...
QByteArray toAscii() const
QString SnapshotViewXZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xz-"))
QGoSynchronizedView * newSynchronizedView(QString iSynchronizedViewName, vtkImageData *iImage)