37 #include <QDesktopWidget> 38 #include <QFileDialog> 39 #include <QInputDialog> 40 #include <QMessageBox> 41 #include <QProgressDialog> 53 #include "ui_dragdrop.h" 61 ui->graphicsViewBefore->setScene(
new QGraphicsScene(
this ) );
62 ui->graphicsViewAfter->setScene(
new QGraphicsScene(
this ) );
63 ui->graphicsViewInput->setScene(
new QGraphicsScene(
this ) );
64 ui->graphicsViewOutput->setScene(
new QGraphicsScene(
this ) );
66 ui->graphicsViewBefore->setFit(
true );
67 ui->graphicsViewAfter->setFit(
true );
69 model =
new QFileSystemModel(
this );
70 model->setRootPath(
"" );
71 ui->treeView->setModel( model );
72 ui->treeView->setAnimated(
false );
73 ui->treeView->setIndentation( 20 );
74 ui->treeView->setSortingEnabled(
true );
75 const QSize availableSize = QApplication::desktop( )->availableGeometry( ui->treeView ).size( );
76 ui->treeView->resize( availableSize / 2 );
77 ui->treeView->setColumnWidth( 0, ui->treeView->width( ) / 3 );
78 ui->treeView->setWindowTitle(
"Pastas" );
79 ui->treeView->sortByColumn( 0, Qt::AscendingOrder );
93 connect( ui->pushButtonInvert, &
PushButton::item,
this, &DragDrop::processInvert );
95 connect( ui->pushButtonBatchBW, &
PushButton::file,
this, &DragDrop::processBatchBW );
97 connect( ui->pushButtonInputFolder, &
PushButton::file,
this, &DragDrop::setInputFolder );
98 connect( ui->pushButtonOutputFolder, &
PushButton::file,
this, &DragDrop::setOutputFolder );
104 ui->pushButtonBatchBW->hide( );
105 ui->pushButtonBatchInvert->hide( );
106 ui->pushButtonBW->hide( );
107 ui->pushButtonInvert->hide( );
114 void DragDrop::processBW(
const QString &text ) {
115 qDebug( ) <<
"text: " << text;
116 if( text ==
"item" ) {
117 on_pushButtonBW_clicked( );
119 if( text ==
"item2" ) {
121 on_pushButtonBW_clicked( );
125 void DragDrop::processInvert(
const QString &text ) {
126 qDebug( ) <<
"text: " << text;
127 if( text ==
"item" ) {
128 on_pushButtonInvert_clicked( );
130 if( text ==
"item2" ) {
132 on_pushButtonInvert_clicked( );
136 void DragDrop::processBatchBW(
const QString &folder ) {
137 QFileInfo info( folder );
138 if( not info.isDir( ) ) {
139 QMessageBox::critical(
this,
"Erro!",
"Não é pasta!" );
142 outputFolder = folder;
144 setOutputFolder( folder );
146 on_pushButtonBatchBW_clicked( );
149 void DragDrop::setInputFolder(
const QString &path ) {
152 ui->groupBoxEntrada->setTitle(
"Pasta Entrada: " + path );
154 loadInputFolderThumbs( );
157 void DragDrop::setOutputFolder(
const QString &path ) {
160 ui->groupBoxSaida->setTitle(
"Pasta Saída: " + path );
162 loadOutputFolderThumbs( );
166 void DragDrop::saveImage(
const QString &text ) {
167 if( outputFolder.isEmpty( ) ) {
168 QMessageBox::critical(
this,
"Erro!",
"Não tem pasta de saída!" );
171 QString filePath = text ==
"item" ? item->
fileInfo( ).absoluteFilePath( ) : item2->
fileInfo( ).absoluteFilePath( );
177 loadOutputFolderThumbs( );
180 void DragDrop::on_pushButtonBW_clicked( ) {
181 if( not item or item->
pixmap( ).isNull( ) ) {
184 QImage temp = item->
pixmap( ).toImage( );
185 temp = temp.convertToFormat( QImage::Format_Grayscale8 );
186 QPixmap pix( QPixmap::fromImage( temp ) );
188 showImage2( pix, item->
fileInfo( ) );
191 void DragDrop::showImage(
const QPixmap &pix,
const QFileInfo &fileInfo ) {
193 ui->graphicsViewBefore->scene( )->removeItem( item );
201 ui->graphicsViewBefore->scene( )->setSceneRect( item->
pixmap( ).rect( ) );
203 ui->graphicsViewBefore->scene( )->addItem( item );
204 ui->graphicsViewBefore->fitInView( ui->graphicsViewBefore->sceneRect( ), Qt::KeepAspectRatio );
209 m_img =
new GuiImage( fileInfo.absoluteFilePath( ), this );
219 void DragDrop::showImage2(
const QPixmap &pix,
const QFileInfo &fileInfo ) {
221 ui->graphicsViewAfter->scene( )->removeItem( item2 );
226 ui->graphicsViewAfter->scene( )->setSceneRect( item2->
pixmap( ).rect( ) );
228 ui->graphicsViewAfter->scene( )->addItem( item2 );
229 ui->graphicsViewAfter->fitInView( ui->graphicsViewAfter->sceneRect( ), Qt::KeepAspectRatio );
236 for(
size_t y = 0; y < y_size; ++y ) {
237 for(
size_t x = 0; x < x_size; ++x ) {
238 res( y, x_size - 1 - x ) = m_img->
getClrImage( )( x, y );
247 size_t iterations = QInputDialog::getInt(
this,
"Iterations",
"How many?", 3 );
248 float kappa = QInputDialog::getInt(
this,
"Kappa",
"How much?", 10 );
249 float radius = QInputDialog::getInt(
this,
"Radius",
"How much?", 1.01 );
259 float low_thres = QInputDialog::getDouble(
this,
"Low threshold",
"Low: ", 0.7 );
260 float hig_thres = QInputDialog::getDouble(
this,
"High threshold",
"High: ", 0.9 );
261 float sigma = QInputDialog::getDouble(
this,
"Sigma",
"Sigma: ", 1.0 );
268 void DragDrop::on_pushButtonInvert_clicked( ) {
269 if( not item or item->
pixmap( ).isNull( ) ) {
272 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
273 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
286 Write( res, QString( outputFolder +
"/" + item->
fileInfo( ).fileName( ) ).toStdString( ) );
289 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
291 QPixmap pix( m_img2->getSlice( 0 ) );
293 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
294 qDebug( ) <<
"y: " << m_img2->getSlice( 0 ).height( );
295 if( pix.isNull( ) ) {
296 qDebug( ) <<
"NULL!";
300 showImage2( pix, item->
fileInfo( ) );
303 void DragDrop::loadInputFolderThumbs( ) {
304 ui->graphicsViewInput->scene( )->clear( );
308 QFileInfoList list = QDir( inputFolder ).entryInfoList( QDir::NoDotAndDotDot | QDir::AllEntries );
310 QProgressDialog progress(
"Reading files...",
"Abort", 0, list.size( ), this );
311 progress.setWindowModality( Qt::WindowModal );
312 for(
auto file : list ) {
314 qDebug( ) <<
"file: " <<
file.fileName( );
321 if( img->
getSlice( 0 ).isNull( ) ) {
324 QPixmap *pix =
new QPixmap( img->
getSlice( 0 ) );
332 QPixmap *pixScaled =
new QPixmap( pix->scaled( 120, ui->graphicsViewInput->viewport( )->height( ) - 30,
333 Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation ) );
337 item->setFlags( QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable );
338 item->setPos( x, y );
342 x += pixScaled->width( ) + 20;
344 ui->graphicsViewInput->scene( )->addItem( item );
346 qApp->processEvents( );
350 void DragDrop::loadOutputFolderThumbs( ) {
351 ui->graphicsViewOutput->scene( )->clear( );
355 QFileInfoList list = QDir( outputFolder ).entryInfoList( QDir::NoDotAndDotDot | QDir::AllEntries );
357 QProgressDialog progress(
"Reading files...",
"Abort", 0, list.size( ), this );
358 progress.setWindowModality( Qt::WindowModal );
359 for(
auto file : list ) {
361 qDebug( ) <<
"file: " <<
file.fileName( );
368 if( img->
getSlice( 0 ).isNull( ) ) {
371 QPixmap *pix =
new QPixmap( img->
getSlice( 0 ) );
376 QPixmap *pixScaled =
new QPixmap( pix->scaled( 120, ui->graphicsViewOutput->viewport( )->height( ) - 30,
377 Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation ) );
381 item->setFlags( QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable );
382 item->setPos( x, y );
386 x += pixScaled->width( ) + 20;
388 ui->graphicsViewOutput->scene( )->addItem( item );
392 void DragDrop::loadFolderThumbs( QString folder, QWidget *widget ) {
394 qDebug( ) <<
"name: " << widget->objectName( );
395 if( widget->layout( ) != nullptr ) {
397 while( ( item = widget->layout( )->takeAt( 0 ) ) !=
nullptr ) {
398 delete item->widget( );
403 if( widget->objectName( ) ==
"scrollAreaLeftWidgetContents" ) {
404 ui->graphicsViewInput->scene( )->clear( );
409 QFileInfoList list = QDir( folder ).entryInfoList( QDir::NoDotAndDotDot | QDir::AllEntries );
411 QProgressDialog progress(
"Reading files...",
"Abort", 0, list.size( ), this );
412 progress.setWindowModality( Qt::WindowModal );
413 for(
auto file : list ) {
415 QPixmap *pix =
new QPixmap(
file.absoluteFilePath( ) );
417 QPixmap *pixScaled =
new QPixmap( pix->scaled( 120, ui->graphicsViewInput->viewport( )->height( ) - 30,
418 Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation ) );
422 item->setFlags( QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable );
423 item->setPos( x, y );
427 x += pixScaled->width( ) + 20;
429 ui->graphicsViewInput->scene( )->addItem( item );
434 QFileInfoList list = QDir( folder ).entryInfoList( QDir::NoDotAndDotDot | QDir::AllEntries );
436 QProgressDialog progress(
"Reading files...",
"Abort", 0, list.size( ), this );
437 progress.setWindowModality( Qt::WindowModal );
438 for(
auto file : list ) {
439 if( progress.wasCanceled( ) ) {
442 progress.setValue( progress.value( ) + 1 );
443 if(
file.isFile( ) ) {
444 createLabel(
file, widget );
449 widget->layout( )->addItem(
new QSpacerItem( 40, 20,
QSizePolicy::Minimum, QSizePolicy::Expanding ) );
452 void DragDrop::on_pushButtonBatchBW_clicked( ) {
453 if( outputFolder.isEmpty( ) ) {
454 QMessageBox::critical(
this,
"Erro!",
"Não há pasta de saída definida!" );
457 auto list = ui->graphicsViewInput->scene( )->items( Qt::AscendingOrder );
458 for(
auto object : list ) {
462 on_pushButtonBW_clicked( );
463 saveImage(
"item2" );
466 timer.setSingleShot(
true );
467 timer.setInterval( 1000 );
469 while( timer.remainingTime( ) > 0 ) {
472 qApp->processEvents( );
477 void DragDrop::createLabel(
const QFileInfo &
file,
const QWidget *widget ) {
479 QPixmap *pixmap =
new QPixmap(
file.absoluteFilePath( ) );
480 if( pixmap->isNull( ) ) {
485 *pixmap = pixmap->scaled( 100, 100, Qt::KeepAspectRatio, Qt::SmoothTransformation );
486 label->setPixmap( *pixmap );
487 widget->layout( )->addWidget( label );
489 connect( label, &
Label::Image,
this, &DragDrop::showImage );
502 void DragDrop::on_pushButtonBatchInvert_clicked( ) {
527 if( outputFolder.isEmpty( ) ) {
528 QMessageBox::critical(
this,
"Erro!",
"Não há pasta de saída definida!" );
531 auto list = ui->graphicsViewInput->scene( )->items( Qt::AscendingOrder );
532 for(
auto object : list ) {
536 on_pushButtonInvert_clicked( );
537 saveImage(
"item2" );
540 timer.setSingleShot(
true );
541 timer.setInterval( 1000 );
543 while( timer.remainingTime( ) > 0 ) {
546 qApp->processEvents( );
551 void DragDrop::on_pushButtonInputFolder_clicked( ) {
552 QString path = QFileDialog::getExistingDirectory(
this,
"Pasta de entrada", QDir::currentPath( ) );
553 if( path.isNull( ) ) {
556 setInputFolder( path );
559 void DragDrop::on_pushButtonOutputFolder_clicked( ) {
560 outputFolder = QFileDialog::getExistingDirectory(
this,
"Pasta de saída", QDir::currentPath( ) );
561 if( outputFolder.isNull( ) ) {
564 setOutputFolder( outputFolder );
567 void DragDrop::on_treeView_doubleClicked(
const QModelIndex &index ) {
578 void DragDrop::on_treeView_clicked(
const QModelIndex &index ) {
579 QString path = model->filePath( index );
580 if( path.isNull( ) ) {
583 setInputFolder( path );
593 COMMENT(
"Reading input data.", 0 );
595 QString
file = QFileDialog::getOpenFileName(
this );
596 Image< int > mask( Read< int >( file.toStdString( ) ) );
598 float m = QInputDialog::getDouble(
this,
"m",
"m: ", 2.0, 0 );
599 float epsilon = QInputDialog::getDouble(
this,
"epsilon",
"epsilon: ", 0.1, 0 );
600 size_t clusters = QInputDialog::getInt(
this,
"clusters",
"clusters: ", 3, 0 );
602 COMMENT(
"Running cmeans.", 0 );
611 COMMENT(
"Assigning final label.", 0 );
612 for(
size_t elm = 0; elm < membership.size( 1 ); ++elm ) {
614 for(
size_t clt = 1; clt < clusters; ++clt ) {
615 cout <<
"clt: " << clt <<
", elm: " << elm <<
"." << endl;
616 if( membership( best_clt, elm ) < membership( clt, elm ) ) {
622 COMMENT(
"Writing result.", 0 );
628 QString
file = QFileDialog::getOpenFileName(
this );
631 float radius = QInputDialog::getDouble(
this,
"radius",
"radius: ", 15.5, 7, 28 );
656 Common::Randomize(
false );
659 QString q_modality = QInputDialog::getText(
this,
"Modality",
"Modality: " );
660 string modality_str( q_modality.toStdString( ) );
662 if( modality_str.compare(
"T2" ) == 0 ) {
663 modality = MRIModality::T2;
665 else if( modality_str.compare(
"PD" ) == 0 ) {
666 modality = MRIModality::PD;
668 else if( modality_str.compare(
"T1" ) != 0 ) {
669 cout <<
"Error: Modality must be T1, T2, or PD. Given \"" << modality_str <<
"\"." << endl;
672 float csf_min_scl = QInputDialog::getDouble(
this,
"csf_min_scl",
"csf_min_scl: ", 0.2 );
673 float csf_max_scl = QInputDialog::getDouble(
this,
"csf_max_scl",
"csf_max_scl: ", 0.3 );
687 float gm_min_scl = QInputDialog::getDouble(
this,
"gm_min_scl",
"gm_min_scl: ", 0.1 );
688 float gm_max_scl = QInputDialog::getDouble(
this,
"gm_max_scl",
"gm_max_scl: ", 0.2 );
701 QString q_scn = QFileDialog::getOpenFileName(
this,
"scn" );
702 Image< int > scn( Read< int >( q_scn.toStdString( ) ) );
703 QString q_mask = QFileDialog::getOpenFileName(
this,
"mask" );
704 Image< int > mask( Read< int >( q_mask.toStdString( ) ) );
761 Feature< int > feats = Bial::ColorMedianFeature< int >( img, adj_rel, 0.5 );
764 float m = QInputDialog::getDouble(
this,
"m",
"m:" );
770 float epsilon = QInputDialog::getDouble(
this,
"epsilon",
"epsilon:" );
776 size_t clusters = QInputDialog::getInt(
this,
"clusters",
"clusters:" );
787 for(
size_t elm = 0; elm < membership.size( 1 ); ++elm ) {
789 for(
size_t clt = 1; clt < clusters; ++clt ) {
790 cout <<
"clt: " << clt <<
", elm: " << elm <<
"." << endl;
791 if( membership( best_clt, elm ) < membership( clt, elm ) ) {
795 result[ feats.
Index( elm ) ] = best_clt + 1;
816 float kappa = QInputDialog::getDouble(
this,
"kappa",
"kappa: ", 0, 0, 1 );
823 float radius = QInputDialog::getDouble(
this,
"radius",
"radius: ", 1.01, 0, 1 );
838 options <<
"RobustDiffusion(0.5)" 839 <<
"RobustDiffusion(1.0)" 840 <<
"PowerDiffusion(1.0)" 841 <<
"PowerDiffusion(2.0)" 842 <<
"GaussianDiffusion";
844 QString option = QInputDialog::getItem(
this,
"Function",
"Function: ", options );
845 if( option ==
"RobustDiffusion(0.5)" ) {
848 if( option ==
"RobustDiffusion(1.0)" ) {
851 if( option ==
"PowerDiffusion(1.0)" ) {
854 if( option ==
"PowerDiffusion(2.0)" ) {
857 if( option ==
"GaussianDiffusion" ) {
882 size_t iterations = QInputDialog::getInt(
this,
"iterations",
"iterations: ", 3 );
894 float kappa = QInputDialog::getDouble(
this,
"kappa",
"kappa: ", 10.0 );
904 float radius = QInputDialog::getDouble(
this,
"radius",
"radius: ", 1.01 );
918 options <<
"RobustDiffusion(0.5)" 919 <<
"RobustDiffusion(1.0)" 920 <<
"PowerDiffusion(1.0)" 921 <<
"PowerDiffusion(2.0)" 922 <<
"GaussianDiffusion";
924 QString option = QInputDialog::getItem(
this,
"Function",
"Function: ", options );
925 if( option ==
"RobustDiffusion(0.5)" ) {
928 if( option ==
"RobustDiffusion(1.0)" ) {
931 if( option ==
"PowerDiffusion(1.0)" ) {
934 if( option ==
"PowerDiffusion(2.0)" ) {
937 if( option ==
"GaussianDiffusion" ) {
957 float radius = QInputDialog::getDouble(
this,
"radius",
"radius: ", 1.9, 0, 1 );
958 float std_dev = QInputDialog::getDouble(
this,
"std_dev",
"std_dev: ", 2, 0, 1 );
984 float radius = QInputDialog::getDouble(
this,
"radius",
"radius:" );
999 float radius = QInputDialog::getDouble(
this,
"radius",
"radius:" );
1022 float conservativeness = QInputDialog::getDouble(
this,
"conservativeness",
"conservativeness:" );
1029 float radius = QInputDialog::getDouble(
this,
"radius",
"radius:" );
1063 QStringList options;
1064 options <<
"RobustDiffusion(0.5)" 1065 <<
"RobustDiffusion(1.0)" 1066 <<
"PowerDiffusion(1.0)" 1067 <<
"PowerDiffusion(2.0)" 1068 <<
"GaussianDiffusion";
1070 QString option = QInputDialog::getItem(
this,
"Function",
"Function: ", options );
1071 if( option ==
"RobustDiffusion(0.5)" ) {
1074 if( option ==
"RobustDiffusion(1.0)" ) {
1077 if( option ==
"PowerDiffusion(1.0)" ) {
1080 if( option ==
"PowerDiffusion(2.0)" ) {
1083 if( option ==
"GaussianDiffusion" ) {
1132 COMMENT(
"Reading parameters.", 0 );
1134 float low_thres = QInputDialog::getDouble(
this,
"low_thres",
"low_thres: ", 0, 0, 1 );
1135 float hig_thres = QInputDialog::getDouble(
this,
"high_thres",
"high_thres: ", 0, 0, 1 );
1136 float sigma = QInputDialog::getDouble(
this,
"sigma",
"sigma: ", 0, 0, 1 );
1138 COMMENT(
"Running Canny.", 0 );
1141 COMMENT(
"Writing result.", 0 );
1157 size_t direction = QInputDialog::getInt(
this,
"direction",
"direction:" );
1184 float sigma = QInputDialog::getDouble(
this,
"sigma",
"sigma:" );
1208 COMMENT(
"Reading inputs.", 0 );
1210 float low_thres = QInputDialog::getDouble(
this,
"low_thres",
"low_thres:" );
1211 float hig_thres = QInputDialog::getDouble(
this,
"high_thres",
"high_thres:" );
1212 float sigma = QInputDialog::getDouble(
this,
"sigma",
"sigma:" );
1213 size_t scales = QInputDialog::getInt(
this,
"scales",
"scales:" );
1216 COMMENT(
"Setting all canny gradient levels to 1.", 0 );
1217 for(
size_t pxl = 0; pxl < grad.
size( ); ++pxl ) {
1218 if( grad( pxl ) != 0 ) {
1260 float low_thres = QInputDialog::getDouble(
this,
"low_thres",
"low_thres:" );
1261 float hig_thres = QInputDialog::getDouble(
this,
"high_thres",
"high_thres:" );
1262 float sigma = QInputDialog::getDouble(
this,
"sigma",
"sigma:" );
1263 size_t scales = QInputDialog::getInt(
this,
"scales",
"scales:" );
1286 float low_thres = QInputDialog::getDouble(
this,
"low_thres",
"low_thres: ", 0, 0, 1 );
1287 float hig_thres = QInputDialog::getDouble(
this,
"high_thres",
"high_thres: ", 0, 0, 1 );
1288 float sigma = QInputDialog::getDouble(
this,
"sigma",
"sigma: ", 0, 0, 1 );
1289 size_t scales = QInputDialog::getDouble(
this,
"scales",
"scales: ", 0, 0, 1 );
1290 float fraction = QInputDialog::getDouble(
this,
"fraction",
"fraction: ", 0, 0, 1 );
1311 float low_thres = QInputDialog::getDouble(
this,
"low_thres",
"low_thres: ", 0, 0, 1 );
1312 float hig_thres = QInputDialog::getDouble(
this,
"high_thres",
"high_thres: ", 0, 0, 1 );
1313 float sigma = QInputDialog::getDouble(
this,
"sigma",
"sigma: ", 0, 0 );
1314 size_t scales = QInputDialog::getInt(
this,
"scales",
"scales: " );
1335 size_t window_side = QInputDialog::getInt(
this,
"window_side",
"window_side: ", 1, 1 );
1336 float low_thres = QInputDialog::getDouble(
this,
"low_thres",
"low_thres: ", 0, 0, 1 );
1337 float hig_thres = QInputDialog::getDouble(
this,
"high_thres",
"high_thres: ", 0, 0, 1 );
1414 std::cout <<
"Rectangles: " << std::endl;
1415 for(
size_t rtg = 0; rtg < best_rectangles.
size( ); ++rtg ) {
1416 std::cout << rtg <<
":" << std::endl;
1417 best_rectangles[ rtg ].
Print( std::cout );
1418 best_rectangles[ rtg ].Draw( regions );
1421 cout << COG[ 0 ] <<
" " << COG[ 1 ] <<
" " << COG[ 2 ] << endl;
1424 return( similarity );
1447 for(
size_t p = 0; p < scn.
size( ); ++p ) {
1448 if( scn[ p ] != 0 ) {
1458 for(
size_t chl = 1; chl < 4; ++chl ) {
1459 for(
size_t pxl = 0; pxl < scn.
size( ); ++pxl ) {
1460 if( scn[ pxl ][ chl ] != 0 ) {
1470 float radius = QInputDialog::getDouble(
this,
"radius",
"radius: " );
1496 float radius = QInputDialog::getDouble(
this,
"radius",
"radius: " );
1505 void DragDrop::image_getslice( ) {
1554 QString folder = QFileDialog::getExistingDirectory(
this,
"Folder" );
1565 size_t classes = QInputDialog::getInt(
this,
"classes",
"classes: " );
1567 for(
size_t elm = 0; elm < feature.Elements( ); ++elm ) {
1568 feature( elm, 0 ) = img[ elm ];
1577 float scalar = QInputDialog::getDouble(
this,
"scalar",
"scalar: " );
1592 QString q_mask = QFileDialog::getOpenFileName(
this,
"mask" );
1593 Image< int > mask( Read< int >( q_mask.toStdString( ) ) );
1600 for(
size_t pxl = 0; pxl < img.
size( ); ++pxl ) {
1601 if( mask[ pxl ] == 0 ) {
1602 for(
size_t ch = 1; ch < 4; ++ch ) {
1603 img[ pxl ][ ch ] = 0;
1620 void DragDrop::on_pushButtonBW_11_clicked( ) {
1621 if( not item or item->
pixmap( ).isNull( ) ) {
1624 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
1625 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
1641 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
1643 QPixmap pix( m_img2->
getSlice( 0 ) );
1645 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
1646 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
1647 if( pix.isNull( ) ) {
1648 qDebug( ) <<
"NULL!";
1652 showImage2( pix, item->
fileInfo( ) );
1655 void DragDrop::on_pushButtonBW_13_clicked( ) {
1656 if( not item or item->
pixmap( ).isNull( ) ) {
1659 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
1660 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
1680 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
1682 QPixmap pix( m_img2->
getSlice( 0 ) );
1684 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
1685 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
1686 if( pix.isNull( ) ) {
1687 qDebug( ) <<
"NULL!";
1691 showImage2( pix, item->
fileInfo( ) );
1694 void DragDrop::on_pushButtonBW_7_clicked( ) {
1695 if( not item or item->
pixmap( ).isNull( ) ) {
1698 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
1699 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
1719 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
1721 QPixmap pix( m_img2->
getSlice( 0 ) );
1723 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
1724 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
1725 if( pix.isNull( ) ) {
1726 qDebug( ) <<
"NULL!";
1730 showImage2( pix, item->
fileInfo( ) );
1733 void DragDrop::on_pushButtonBW_10_clicked( ) {
1734 if( not item or item->
pixmap( ).isNull( ) ) {
1737 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
1738 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
1758 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
1760 QPixmap pix( m_img2->
getSlice( 0 ) );
1762 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
1763 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
1764 if( pix.isNull( ) ) {
1765 qDebug( ) <<
"NULL!";
1769 showImage2( pix, item->
fileInfo( ) );
1772 void DragDrop::on_pushButtonBW_9_clicked( ) {
1773 if( not item or item->
pixmap( ).isNull( ) ) {
1776 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
1777 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
1797 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
1799 QPixmap pix( m_img2->
getSlice( 0 ) );
1801 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
1802 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
1803 if( pix.isNull( ) ) {
1804 qDebug( ) <<
"NULL!";
1808 showImage2( pix, item->
fileInfo( ) );
1811 void DragDrop::on_pushButtonBW_8_clicked( ) {
1812 if( not item or item->
pixmap( ).isNull( ) ) {
1815 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
1816 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
1836 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
1838 QPixmap pix( m_img2->
getSlice( 0 ) );
1840 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
1841 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
1842 if( pix.isNull( ) ) {
1843 qDebug( ) <<
"NULL!";
1847 showImage2( pix, item->
fileInfo( ) );
1850 void DragDrop::on_pushButtonBW_5_clicked( ) {
1851 if( not item or item->
pixmap( ).isNull( ) ) {
1854 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
1855 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
1875 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
1877 QPixmap pix( m_img2->
getSlice( 0 ) );
1879 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
1880 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
1881 if( pix.isNull( ) ) {
1882 qDebug( ) <<
"NULL!";
1886 showImage2( pix, item->
fileInfo( ) );
1889 void DragDrop::on_pushButtonBW_4_clicked( ) {
1890 if( not item or item->
pixmap( ).isNull( ) ) {
1893 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
1894 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
1914 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
1916 QPixmap pix( m_img2->
getSlice( 0 ) );
1918 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
1919 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
1920 if( pix.isNull( ) ) {
1921 qDebug( ) <<
"NULL!";
1925 showImage2( pix, item->
fileInfo( ) );
1928 void DragDrop::on_pushButtonBW_3_clicked( ) {
1929 if( not item or item->
pixmap( ).isNull( ) ) {
1932 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
1933 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
1953 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
1955 QPixmap pix( m_img2->
getSlice( 0 ) );
1957 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
1958 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
1959 if( pix.isNull( ) ) {
1960 qDebug( ) <<
"NULL!";
1964 showImage2( pix, item->
fileInfo( ) );
1967 void DragDrop::on_pushButtonBW_14_clicked( ) {
1968 if( not item or item->
pixmap( ).isNull( ) ) {
1971 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
1972 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
1992 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
1994 QPixmap pix( m_img2->
getSlice( 0 ) );
1996 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
1997 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
1998 if( pix.isNull( ) ) {
1999 qDebug( ) <<
"NULL!";
2003 showImage2( pix, item->
fileInfo( ) );
2006 void DragDrop::on_pushButtonBW_15_clicked( ) {
2007 if( not item or item->
pixmap( ).isNull( ) ) {
2010 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2011 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2031 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2033 QPixmap pix( m_img2->
getSlice( 0 ) );
2035 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2036 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2037 if( pix.isNull( ) ) {
2038 qDebug( ) <<
"NULL!";
2042 showImage2( pix, item->
fileInfo( ) );
2045 void DragDrop::on_pushButtonBW_16_clicked( ) {
2046 if( not item or item->
pixmap( ).isNull( ) ) {
2049 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2050 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2070 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2072 QPixmap pix( m_img2->
getSlice( 0 ) );
2074 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2075 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2076 if( pix.isNull( ) ) {
2077 qDebug( ) <<
"NULL!";
2081 showImage2( pix, item->
fileInfo( ) );
2084 void DragDrop::on_pushButtonBW_17_clicked( ) {
2085 if( not item or item->
pixmap( ).isNull( ) ) {
2088 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2089 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2109 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2111 QPixmap pix( m_img2->
getSlice( 0 ) );
2113 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2114 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2115 if( pix.isNull( ) ) {
2116 qDebug( ) <<
"NULL!";
2120 showImage2( pix, item->
fileInfo( ) );
2123 void DragDrop::on_pushButtonBW_18_clicked( ) {
2124 if( not item or item->
pixmap( ).isNull( ) ) {
2127 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2128 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2148 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2150 QPixmap pix( m_img2->
getSlice( 0 ) );
2152 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2153 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2154 if( pix.isNull( ) ) {
2155 qDebug( ) <<
"NULL!";
2159 showImage2( pix, item->
fileInfo( ) );
2162 void DragDrop::on_pushButtonBW_19_clicked( ) {
2163 if( not item or item->
pixmap( ).isNull( ) ) {
2166 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2167 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2187 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2189 QPixmap pix( m_img2->
getSlice( 0 ) );
2191 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2192 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2193 if( pix.isNull( ) ) {
2194 qDebug( ) <<
"NULL!";
2198 showImage2( pix, item->
fileInfo( ) );
2201 void DragDrop::on_pushButtonBW_20_clicked( ) {
2202 if( not item or item->
pixmap( ).isNull( ) ) {
2205 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2206 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2226 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2228 QPixmap pix( m_img2->
getSlice( 0 ) );
2230 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2231 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2232 if( pix.isNull( ) ) {
2233 qDebug( ) <<
"NULL!";
2237 showImage2( pix, item->
fileInfo( ) );
2240 void DragDrop::on_pushButtonBW_21_clicked( ) {
2241 if( not item or item->
pixmap( ).isNull( ) ) {
2244 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2245 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2265 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2267 QPixmap pix( m_img2->
getSlice( 0 ) );
2269 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2270 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2271 if( pix.isNull( ) ) {
2272 qDebug( ) <<
"NULL!";
2276 showImage2( pix, item->
fileInfo( ) );
2279 void DragDrop::on_pushButtonBW_22_clicked( ) {
2280 if( not item or item->
pixmap( ).isNull( ) ) {
2283 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2284 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2304 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2306 QPixmap pix( m_img2->
getSlice( 0 ) );
2308 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2309 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2310 if( pix.isNull( ) ) {
2311 qDebug( ) <<
"NULL!";
2315 showImage2( pix, item->
fileInfo( ) );
2318 void DragDrop::on_pushButtonBW_23_clicked( ) {
2319 if( not item or item->
pixmap( ).isNull( ) ) {
2322 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2323 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2343 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2345 QPixmap pix( m_img2->
getSlice( 0 ) );
2347 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2348 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2349 if( pix.isNull( ) ) {
2350 qDebug( ) <<
"NULL!";
2354 showImage2( pix, item->
fileInfo( ) );
2357 void DragDrop::on_pushButtonBW_24_clicked( ) {
2358 if( not item or item->
pixmap( ).isNull( ) ) {
2361 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2362 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2382 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2384 QPixmap pix( m_img2->
getSlice( 0 ) );
2386 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2387 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2388 if( pix.isNull( ) ) {
2389 qDebug( ) <<
"NULL!";
2393 showImage2( pix, item->
fileInfo( ) );
2396 void DragDrop::on_pushButtonBW_25_clicked( ) {
2397 if( not item or item->
pixmap( ).isNull( ) ) {
2400 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2401 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2421 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2423 QPixmap pix( m_img2->
getSlice( 0 ) );
2425 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2426 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2427 if( pix.isNull( ) ) {
2428 qDebug( ) <<
"NULL!";
2432 showImage2( pix, item->
fileInfo( ) );
2435 void DragDrop::on_pushButtonBW_26_clicked( ) {
2436 if( not item or item->
pixmap( ).isNull( ) ) {
2439 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2440 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2460 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2462 QPixmap pix( m_img2->
getSlice( 0 ) );
2464 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2465 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2466 if( pix.isNull( ) ) {
2467 qDebug( ) <<
"NULL!";
2471 showImage2( pix, item->
fileInfo( ) );
2474 void DragDrop::on_pushButtonBW_27_clicked( ) {
2475 if( not item or item->
pixmap( ).isNull( ) ) {
2478 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2479 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2499 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2501 QPixmap pix( m_img2->
getSlice( 0 ) );
2503 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2504 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2505 if( pix.isNull( ) ) {
2506 qDebug( ) <<
"NULL!";
2510 showImage2( pix, item->
fileInfo( ) );
2513 void DragDrop::on_pushButtonBW_28_clicked( ) {
2514 if( not item or item->
pixmap( ).isNull( ) ) {
2517 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2518 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2538 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2540 QPixmap pix( m_img2->
getSlice( 0 ) );
2542 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2543 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2544 if( pix.isNull( ) ) {
2545 qDebug( ) <<
"NULL!";
2549 showImage2( pix, item->
fileInfo( ) );
2552 void DragDrop::on_pushButtonBW_29_clicked( ) {
2553 if( not item or item->
pixmap( ).isNull( ) ) {
2556 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2557 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2577 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2579 QPixmap pix( m_img2->
getSlice( 0 ) );
2581 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2582 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2583 if( pix.isNull( ) ) {
2584 qDebug( ) <<
"NULL!";
2588 showImage2( pix, item->
fileInfo( ) );
2591 void DragDrop::on_pushButtonBW_30_clicked( ) {
2592 if( not item or item->
pixmap( ).isNull( ) ) {
2595 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2596 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2616 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2618 QPixmap pix( m_img2->
getSlice( 0 ) );
2620 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2621 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2622 if( pix.isNull( ) ) {
2623 qDebug( ) <<
"NULL!";
2627 showImage2( pix, item->
fileInfo( ) );
2630 void DragDrop::on_pushButtonBW_31_clicked( ) {
2631 if( not item or item->
pixmap( ).isNull( ) ) {
2634 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2635 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2655 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2657 QPixmap pix( m_img2->
getSlice( 0 ) );
2659 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2660 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2661 if( pix.isNull( ) ) {
2662 qDebug( ) <<
"NULL!";
2666 showImage2( pix, item->
fileInfo( ) );
2669 void DragDrop::on_pushButtonBW_32_clicked( ) {
2670 if( not item or item->
pixmap( ).isNull( ) ) {
2673 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2674 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2694 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2696 QPixmap pix( m_img2->
getSlice( 0 ) );
2698 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2699 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2700 if( pix.isNull( ) ) {
2701 qDebug( ) <<
"NULL!";
2705 showImage2( pix, item->
fileInfo( ) );
2708 void DragDrop::on_pushButtonBW_33_clicked( ) {
2709 if( not item or item->
pixmap( ).isNull( ) ) {
2712 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2713 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2733 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2735 QPixmap pix( m_img2->
getSlice( 0 ) );
2737 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2738 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2739 if( pix.isNull( ) ) {
2740 qDebug( ) <<
"NULL!";
2744 showImage2( pix, item->
fileInfo( ) );
2747 void DragDrop::on_pushButtonBW_34_clicked( ) {
2748 if( not item or item->
pixmap( ).isNull( ) ) {
2751 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2752 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2772 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2774 QPixmap pix( m_img2->
getSlice( 0 ) );
2776 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2777 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2778 if( pix.isNull( ) ) {
2779 qDebug( ) <<
"NULL!";
2783 showImage2( pix, item->
fileInfo( ) );
2786 void DragDrop::on_pushButtonBW_35_clicked( ) {
2787 if( not item or item->
pixmap( ).isNull( ) ) {
2790 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2791 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2811 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2813 QPixmap pix( m_img2->
getSlice( 0 ) );
2815 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2816 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2817 if( pix.isNull( ) ) {
2818 qDebug( ) <<
"NULL!";
2822 showImage2( pix, item->
fileInfo( ) );
2825 void DragDrop::on_pushButtonBW_37_clicked( ) {
2826 if( not item or item->
pixmap( ).isNull( ) ) {
2829 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2830 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2850 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2852 QPixmap pix( m_img2->
getSlice( 0 ) );
2854 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2855 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2856 if( pix.isNull( ) ) {
2857 qDebug( ) <<
"NULL!";
2861 showImage2( pix, item->
fileInfo( ) );
2864 void DragDrop::on_pushButtonBW_38_clicked( ) {
2865 if( not item or item->
pixmap( ).isNull( ) ) {
2868 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2869 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2889 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2891 QPixmap pix( m_img2->
getSlice( 0 ) );
2893 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2894 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2895 if( pix.isNull( ) ) {
2896 qDebug( ) <<
"NULL!";
2900 showImage2( pix, item->
fileInfo( ) );
2903 void DragDrop::on_pushButtonBW_39_clicked( ) {
2904 if( not item or item->
pixmap( ).isNull( ) ) {
2907 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2908 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2928 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2930 QPixmap pix( m_img2->
getSlice( 0 ) );
2932 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2933 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2934 if( pix.isNull( ) ) {
2935 qDebug( ) <<
"NULL!";
2939 showImage2( pix, item->
fileInfo( ) );
2942 void DragDrop::on_pushButtonBW_40_clicked( ) {
2943 if( not item or item->
pixmap( ).isNull( ) ) {
2946 if( item->
fileInfo( ).suffix( ) ==
"dcm" ) {
2947 QMessageBox::critical(
this,
"Erro!",
"Suporte a escrita de DICOM ainda não implementado!" );
2967 m_img2 =
new GuiImage( outputFolder +
"/" + item->
fileInfo( ).fileName( ), this );
2969 QPixmap pix( m_img2->
getSlice( 0 ) );
2971 qDebug( ) <<
"x: " << m_img2->
getSlice( 0 ).width( );
2972 qDebug( ) <<
"y: " << m_img2->
getSlice( 0 ).height( );
2973 if( pix.isNull( ) ) {
2974 qDebug( ) <<
"NULL!";
2978 showImage2( pix, item->
fileInfo( ) );
2981 void DragDrop::on_groupBoxSaida_toggled(
bool checked ) {
2982 ui->graphicsViewOutput->setVisible( checked );
2983 ui->pushButtonOutputFolder->setVisible( checked );
Image< int > TissueSegmentation(const Image< D > &img, const Image< D > &msk, D tissue_intensity, float scl_min, float scl_max, bool hierarchical)
Set labeled clusters into low and high intensity tissues. Low intensity tissue pixels have their labe...
const Vector< size_t > & Index() const
Returns a constant reference to the index vector.
Vector< size_t > COG(const Image< D > &img)
Computes the coordenates of the center of gravity of the input image.
Image< D > Morphological(const Image< D > &image)
Computes the gradient image (dilation - erosion) using spherical adjacency relation of one pixel of r...
Image< D > BorderPixels(const Image< D > &img, const Adjacency &adj)
Pixels belong to the border if they have at last one adjacent pixel with distinct intensity...
Image< D > MultiScaleCanny(const Image< D > &img, float lower_threshold, float higher_threshold, float sigma, size_t scales)
Returns multi scale Canny edge detection image. Lower and higher threshold as frequencies from 0...
size_t Dims() const
Returns the number of dimensions of the image.
void saveFile(const QString &item)
static void Write(const Image< D > &img, const std::string &filename)
Write the input image to a file with given name.
Image< D > InhomogeneityCorrection(const Image< D > &img, const Image< D > &msk, float radius=15.5, size_t compression=2, MRIModality modality=MRIModality::T1)
Computes bias surface based on white matter pixels in the image.
Image< D > Mean(const Image< D > &img, float radius)
Returns the mean filtered image with the given radius.
Vector< float > PixelSize() const
Returns a Vector with all pixel dimensions.
Image< int > MinimumSpanningForest(const Image< D > &img, const Feature< D > feature, size_t regions)
Segmentation by minimum spanning forest algorithm.
The GuiImage class is a bridge to the Bial::Image data structure to the QImage data structure...
Image< D > DirectionalSobel(const Image< D > &img, size_t direction)
Returns the directional Sobel filter over image.
Image< D > Canny(const Image< D > &suppressed_sobel, float lower_threshold, float higher_threshold)
Returns Canny edge detection image. Lower and higher threshold as frequencies from 0...
Diffusion functions to compute annisotropic filtering and other algorithms.
Image< D > NonMaxSobelSuppression(const Image< D > &img)
Returns the sobel magnitude image with non-maximum intensities suppressed.
Image< D > Dilate(const Image< D > &image)
Computes the dilation of input image using spherical adjacency relation of one pixel of radius...
Matrix< double > Run(bool verbose=false)
Computes fuzzy c-means from 3D image pixels, according to the choosen feature vector.
void Gabor(const Image< D > &img, float sigma, Image< D > *magnitude=nullptr, Image< int > *direction=nullptr)
Returns the directional Gabor filter over image.
Image< Color > Merge(Vector< Image< D > > &img_vector)
Static constructor of a color image, from an vector of monochromatic images.
Image< D > AdaptiveAnisotropicDiffusion(Image< D > img, const DiffusionFunction *diff_func, float init_kappa, float radius=1.0)
Computes and returns a filtered image by anisotropic diffusion.
Image< D > Segmentation(const Image< D > &img, const std::string &orientation)
Returns a binary mask of segmented heart.
void Set(D val)
Sets val to each element of the entire image.
Content: FuzzyCMeans class Description: Implementation of Fuzzy C-Means clustering algorithm for 3D...
Adjacency relation with indexes following gray code sequency. Future add-on's: none.
QPixmap getSlice(size_t view)
getSlice calculates and returns a QImage with the current slice of the view.
Image< D > Median(const Image< D > &img, float radius)
Returns the median filtered image with the given radius.
void Image(const QPixmap &, const QString &)
Image< D > MultiSubScaleCanny(const Image< D > &img, float lower_threshold, float higher_threshold, float sigma, size_t scales)
Returns multi scale Canny edge detection image. Lower and higher threshold as frequencies from 0...
Image< D > CloseHoles(const Image< D > &canny)
Returns Canny gradient with one pixel wide holes closed.
Adjacency HyperSpheric(float radius=1.0, size_t dims=4)
Create and return a hyper-spheric adjacency relation of radius 'radius' and with dim dimensions...
Vector< size_t > Dim() const
Returns a Vector with image dimensions.
O & Print(O &os) const
Prints vector containts to output stream os.
Bial::Image< int > & getIntImage() const
get*Image
Image< D > AnisotropicDiffusion(Image< D > img, const DiffusionFunction *diff_func, float kappa, size_t iterations, float radius=1.0)
Computes and returns a filtered image by anisotropic diffusion.
Image< D > Gaussian(const Image< D > &img, float radius=2.0, float std_dev=2.0)
Returns the median filtered image with the given radius.
DragDrop(QWidget *parent=0)
size_t size() const noexcept
Returns vector size.
Adjacency Circular(float radius=1.0)
Create and return a 2D circular adjacency relation of radius 'radius'.
Image< D > SkullStripping(const Image< D > &img, const std::string &orientation)
Segments the brain from the background.
void Write(const Feature< D > &feat, const std::string &filename)
Writes data to file.
Image< D > MultiScaleSizeCanny(const Image< D > &img, float lower_threshold, float higher_threshold, float sigma, size_t scales, float fraction)
Returns multi scale Canny edge detection image. Lower and higher threshold as frequencies from 0...
Vector< size_t > WeightedCOG(const Image< D > &img, const std::string &orientation)
Returns a Vector with COG coordinates, based on intensity weighted values of the image and distance f...
Image< D > Erode(const Image< D > &image)
Computes the erosion of input image using spherical adjacency relation of one pixel of radius...
void setPix2(const QPixmap &value)
size_t size() const
Returns the image size. Same as Size( ), just for compatibility with std containers.
The Image class is used to handle N-Dimensional images, and has support to Read and Write image files...
Image< D > ScaleCanny(const Image< D > &img, size_t window_scale, float lower_threshold, float higher_threshold)
Returns a scaled Canny edge detection image. Lower and higher threshold as frequencies from 0...
Adjacency relation and forward iteratior related to a matrix.
Bial::Image< Bial::Color > & getClrImage() const
D Minimum(const Image< D > &img, const Image< D > &msk)
Returns the minimum intensity in img restricted to msk pixels which intensities are different form ze...
void Image(const QPixmap &, const QFileInfo &)
QFileInfo fileInfo() const
Image< int > Watershed(Image< D > &gradient, float radius=1.1f)
Returns the label image from Watershed segmentation algorithm using local minima as the leaking point...
Bial::Image< float > & getFltImage() const
Feature vector class. It is essentialy a matrix where, the first dimention refers to the feature and ...
Image< D > OptimalAnisotropicDiffusion(Image< D > img, const DiffusionFunction *diff_func, float radius, float conservativeness)
Threads implementation for anisotropic diffusion filter.