43 QTreeWidgetItem* parent_it = parent();
45 while(parent_it !=
NULL)
60 parent_it = parent_it->parent();
63 if(scan_id >= 0 && cam_id >= 0)
70 cv::Mat image =
m_sdm->loadImageData(scan_id, cam_id);
72 cv::cvtColor(image, cv_rgb, cv::COLOR_BGR2RGB);
76 QPixmap pixmap = QPixmap::fromImage(*q_image);
78 QGraphicsScene* gs =
new QGraphicsScene();
79 gs->addPixmap(pixmap);
80 gs->setSceneRect(pixmap.rect());
103 std::cout <<
"Couldnt find scan_id or cam_id. cant load Image from HDF5 file." << std::endl;
115 QImage* ret =
nullptr;
116 if(cv_rgb.type() == CV_8U)
118 ret =
new QImage(cv_rgb.data, cv_rgb.rows, cv_rgb.cols, cv_rgb.step, QImage::Format_Indexed8);
119 }
else if(cv_rgb.type() == CV_8UC3) {
121 ret =
new QImage(cv_rgb.data, cv_rgb.cols, cv_rgb.rows, cv_rgb.step, QImage::Format_RGB888);
LVRGraphicsView * m_graphics_view
void reload(vtkSmartPointer< vtkRenderer > renderer)
std::shared_ptr< ScanDataManager > m_sdm
QGraphicsScene * m_graphics_scene
void setVisibility(bool visible)
void set_modifiers(Qt::KeyboardModifiers modifiers)
void graphicsViewClosed()
LVRCvImageItem(std::shared_ptr< ScanDataManager > sdm, vtkSmartPointer< vtkRenderer > renderer, QString name="", QTreeWidgetItem *parent=NULL)
vtkSmartPointer< vtkRenderer > m_renderer
QImage * convertCvImageToQt(cv::Mat &cv_img)