diff --git a/Code/Seg/BSTools/bsaccumulatoritem.cpp b/Code/Seg/BSTools/bsaccumulatoritem.cpp index 31aba676e0c094af79e9bd440b48a75ba36fe5a8..30d1306f4a3467a411349cd634c46c60510d5501 100755 --- a/Code/Seg/BSTools/bsaccumulatoritem.cpp +++ b/Code/Seg/BSTools/bsaccumulatoritem.cpp @@ -108,7 +108,7 @@ void BSAccumulatorItem::paint (QPainter *painter, addText (painter, QString ("R resolution : ") + QString::number (resol[0]) + QString (" pixels x ") + QString::number (resol[1]) + QString (" degrees")); - addText (painter, QString ("P sub-pixellisation level : ") + addText (painter, QString ("W sub-pixellisation level : ") + QString::number (hugues->getSubpix ())); addText (painter, QString ("F selectivity : ") + QString::number (hugues->getSelectionThreshold ()) diff --git a/Code/Seg/BSTools/bsaccumulatoritem.h b/Code/Seg/BSTools/bsaccumulatoritem.h index 80c923e3fef8960b5b7d42f5203d5805a575fd8e..6095f22376de009047e0083709f407e67b6e4589 100755 --- a/Code/Seg/BSTools/bsaccumulatoritem.h +++ b/Code/Seg/BSTools/bsaccumulatoritem.h @@ -47,6 +47,16 @@ public: void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + /** + * \brief Returns the accumulator width. + */ + inline int getWidth () const { return width; } + + /** + * \brief Returns the accumulator height. + */ + inline int getHeight () const { return height; } + /** * \brief Switches on or off the information text display modality. */ diff --git a/Code/Seg/BSTools/bsaccumulatorview.cpp b/Code/Seg/BSTools/bsaccumulatorview.cpp index 4610b547726b700fc5d75e4a891bdea85ce73a92..5618ea4b91e0778ab049d36955d03df2613c76a4 100755 --- a/Code/Seg/BSTools/bsaccumulatorview.cpp +++ b/Code/Seg/BSTools/bsaccumulatorview.cpp @@ -65,7 +65,7 @@ bool BSAccumulatorView::processKeyEvent (QKeyEvent *event) (event->modifiers () & Qt::ShiftModifier) == 0); break; - case Qt::Key_P : + case Qt::Key_W : processed = grid->subpixellise ( (event->modifiers () & Qt::ShiftModifier) != 0); break; @@ -74,6 +74,14 @@ bool BSAccumulatorView::processKeyEvent (QKeyEvent *event) processed = grid->setFilterSelectivity ( (event->modifiers () & Qt::ShiftModifier) == 0); break; + + case Qt::Key_P : // Capture + viewport()->grab ( + QRect (QPoint (0, 0), + QSize (grid->getWidth(), grid->getHeight())) + ).toImage().save ("accu.png"); + cout << "Accumulator shot in capture.png" << endl; + break; } return processed; } diff --git a/Code/Seg/BSTools/bsdetectionwidget.cpp b/Code/Seg/BSTools/bsdetectionwidget.cpp index 700674c89e4c8ca2be0c9757f0e204b355829303..8f0e344f5db3424266cb0643c7927c1a345b345f 100755 --- a/Code/Seg/BSTools/bsdetectionwidget.cpp +++ b/Code/Seg/BSTools/bsdetectionwidget.cpp @@ -285,6 +285,7 @@ void BSDetectionWidget::switchIdetAnalyzer () { idetview = new BSIdetView (&detector); idetview->setImage (&loadedImage, gMap); + idetview->update (); idetview->show (); } } @@ -877,7 +878,7 @@ void BSDetectionWidget::displayDetectionResult () // Update auxiliary view if not dragging if (nodrag) { - if (idetview != NULL) idetview->scene()->update (); + if (idetview != NULL) idetview->update (); if (profileview != NULL) { profileview->buildScans (p1, p2); diff --git a/Code/Seg/BSTools/bsidetitem.cpp b/Code/Seg/BSTools/bsidetitem.cpp index 77f7ba541990e52094cb4ab3640e21627ae91689..c4ee2c4e99d091543f9da77874f5fd75c42a4243 100755 --- a/Code/Seg/BSTools/bsidetitem.cpp +++ b/Code/Seg/BSTools/bsidetitem.cpp @@ -31,6 +31,9 @@ BSIdetItem::BSIdetItem (BSDetector *detector) displayItem = DISPLAY_INTENSITY; det = detector; ds = NULL; + + offx = 0; + offy = 0; } @@ -49,7 +52,7 @@ void BSIdetItem::paint (QPainter *painter, if (det->getBlurredSegments().empty () || det->getMaxTrials () > 0) { - buildScans (); +// buildScans (); paintStripes (painter); } } @@ -67,6 +70,9 @@ void BSIdetItem::setImage (QImage *image, VMap *idata) void BSIdetItem::buildScans () { + if ((! det->getBlurredSegments().empty ()) && det->getMaxTrials () <= 0) + return; + if (ds != NULL) { delete ds; diff --git a/Code/Seg/BSTools/bsidetitem.h b/Code/Seg/BSTools/bsidetitem.h index bc594acbd4eb8c6665990d92e53e63bce8291da2..dd3485b3fb9606df61cab476e614cc1781763bd8 100755 --- a/Code/Seg/BSTools/bsidetitem.h +++ b/Code/Seg/BSTools/bsidetitem.h @@ -52,6 +52,16 @@ public: else return ("No info"); } + /** + * \brief Returns the detection view width. + */ + inline int getWidth () const { return width; } + + /** + * \brief Returns the detection view height. + */ + inline int getHeight () const { return height; } + /** * \brief Increments the current stripe index. * @param inc Direction (1 for rightwards, -1 for leftwards) @@ -70,8 +80,11 @@ public: */ void toggleDisplay (bool next); + /** + * \brief Sets the image scan area from the detection initial scan. + */ + void buildScans (); -protected: private: @@ -137,11 +150,6 @@ private: */ void paintStripes (QPainter *painter); - /** - * \brief Sets the image scan area from the detection initial scan. - */ - void buildScans (); - }; #endif diff --git a/Code/Seg/BSTools/bsidetview.cpp b/Code/Seg/BSTools/bsidetview.cpp index dc6cfcc116fd7dd005af62a2930d91efd8cf0f0e..6b3beea667f6e326619ef14ca3c4fd58ef10889f 100755 --- a/Code/Seg/BSTools/bsidetview.cpp +++ b/Code/Seg/BSTools/bsidetview.cpp @@ -49,28 +49,43 @@ bool BSIdetView::processKeyEvent (QKeyEvent *event) case Qt::Key_I : idet->toggleDisplay ((event->modifiers () & Qt::ShiftModifier) == 0); setWindowTitle (idet->itemTitle ()); - idet->update (); + scene()->update (); + break; + + case Qt::Key_P : // Capture + viewport()->grab ( + QRect (QPoint (0, 0), + QSize (idet->getWidth(), idet->getHeight())) + ).toImage().save ("firstDetection.png"); + cout << "First detection window shot in capture.png" << endl; break; case Qt::Key_Left : idet->incX (-1); - idet->update (); + scene()->update (); break; case Qt::Key_Right : idet->incX (1); - idet->update (); + scene()->update (); break; case Qt::Key_Up : idet->incY (1); - idet->update (); + scene()->update (); break; case Qt::Key_Down : idet->incY (-1); - idet->update (); + scene()->update (); break; } return false; } + + +void BSIdetView::update () +{ + idet->buildScans (); + scene()->update (); +} diff --git a/Code/Seg/BSTools/bsidetview.h b/Code/Seg/BSTools/bsidetview.h index 18182afaa27e4643285f6c09ba6fbd125ae4822b..efa3014b86616d2ef42cd773d9933ea229a4c30d 100755 --- a/Code/Seg/BSTools/bsidetview.h +++ b/Code/Seg/BSTools/bsidetview.h @@ -47,6 +47,11 @@ public: */ bool processKeyEvent (QKeyEvent *event); + /** + * \brief Update the initial detection widget. + */ + void update (); + private: diff --git a/Code/Seg/BSTools/bsprofileitem.h b/Code/Seg/BSTools/bsprofileitem.h index 3ca04bca9178bc1c8394b0757599e293f51b8410..51078bd87a993e0a3040925eebd69207aeb37ecc 100755 --- a/Code/Seg/BSTools/bsprofileitem.h +++ b/Code/Seg/BSTools/bsprofileitem.h @@ -65,6 +65,16 @@ public: else return ("No profile"); } + /** + * \brief Returns the widget display width. + */ + inline int getWidth () const { return widWidth; } + + /** + * \brief Returns the widget display height. + */ + inline int getHeight () const { return widHeight; } + /** * \brief Increments the current stripe index. * @param inc Direction (1 for leftwards, -1 for rightwards) diff --git a/Code/Seg/BSTools/bsprofileview.cpp b/Code/Seg/BSTools/bsprofileview.cpp index e20f8b7ab5233a40bd34160b306c2940e7db6c65..31208ffa7a0d1d0fa2c1a37ab2f63a1402694eb8 100755 --- a/Code/Seg/BSTools/bsprofileview.cpp +++ b/Code/Seg/BSTools/bsprofileview.cpp @@ -73,6 +73,14 @@ bool BSProfileView::processKeyEvent (QKeyEvent *event) prof->update (); break; + case Qt::Key_P : // Capture + viewport()->grab ( + QRect (QPoint (0, 0), + QSize (prof->getWidth(), prof->getHeight())) + ).toImage().save ("profiles.png"); + cout << "Profiles shot in capture.png" << endl; + break; + case Qt::Key_Up : prof->incStripe (1); prof->update (); diff --git a/Code/Seg/BSTools/bsstructureitem.h b/Code/Seg/BSTools/bsstructureitem.h index f2095debd8abe4c394c994412297c1d21aacf825..4b2d66036731eeef39a4fcc1584c3b9029cc447c 100755 --- a/Code/Seg/BSTools/bsstructureitem.h +++ b/Code/Seg/BSTools/bsstructureitem.h @@ -21,6 +21,16 @@ public: */ ~BSStructureItem (); + /** + * \brief Return the width. + */ + inline int getWidth () const { return w; } + + /** + * \brief Return the height. + */ + inline int getHeight () const { return h; } + /** * \brief Return the zoom factor. */ diff --git a/Code/Seg/BSTools/bsstructureview.cpp b/Code/Seg/BSTools/bsstructureview.cpp index 044d1b0eed73153de2caa204528f74c413bf9a4e..aec15cd446f7a07fc148a9dbca518b75e1bb1fc8 100755 --- a/Code/Seg/BSTools/bsstructureview.cpp +++ b/Code/Seg/BSTools/bsstructureview.cpp @@ -115,6 +115,14 @@ bool BSStructureView::processKeyEvent (QKeyEvent *event) } break; + case Qt::Key_P : // Capture + viewport()->grab ( + QRect (QPoint (0, 0), + QSize (grid->getWidth(), grid->getHeight())) + ).toImage().save ("structure.png"); + cout << "Structure shot in capture.png" << endl; + break; + case Qt::Key_Plus : // Zoom in grid->zoomIn (); updateBackground (); diff --git a/Methode/ctrl.tex b/Methode/ctrl.tex index 481f53fca709e3158f22ada09ab8f62176287037..eff09ff1e9c6cf6492f206293c7dd87ab94b0133 100755 --- a/Methode/ctrl.tex +++ b/Methode/ctrl.tex @@ -71,9 +71,11 @@ Ctrl-y && Commute l'affichage des pixels des segments flous. \\ \newpage \begin{tabular}{|rcl|} \hline -\multicolumn{3}{|l|}{Contr\^ole de l'extraction : \hspace{9.0cm} .} \\ +\multicolumn{3}{|l|}{Contr\^ole des fen\^etres auxiliaires : +\hspace{9.0cm} .} \\ i && Changement d'info \\ v && Commute l'affichage du texte \\ +p && Capture la fen\^etre dans un fichier .png \\ \hline \hline \multicolumn{3}{|l|}{Analyse des segments flous extraits :} \\ Ctrl-i && Commute le type d'affichage des scans \\ @@ -84,7 +86,7 @@ $< \wedge > \vee$ && D\'ecalage de l'observation \\ \multicolumn{3}{|l|}{Analyse des accumulateurs :} \\ s && Taille de l'accumulateur (nombre de cellules) \\ r && R\'esolution (espace couvert par une cellule) \\ -p && Sub-pixelisation (pour le vote) \\ +w && Sub-pixelisation (pour le vote) \\ f && S\'electivit\'e du filtre \\ \hline \hline \multicolumn{3}{|l|}{Analyse des profils :} \\