<x>0</x>
<y>0</y>
<width>295</width>
- <height>439</height>
+ <height>355</height>
</rect>
</property>
<property name="sizePolicy">
<rect>
<x>0</x>
<y>0</y>
+ vvInfoPanel.ui
+ <width>281</width>
+ <height>341</height>
<width>281</width>
<height>425</height>
+ 1.3
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
</property>
</widget>
</item>
- <item row="12" column="0">
- <widget class="QLabel" name="ULStaticLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;"> Top Left :</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="12" column="1">
- <widget class="QLabel" name="ULLabel">
+ <item row="14" column="0" colspan="2">
+ <widget class="QLabel" name="transformationLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<property name="text">
<string/>
</property>
- </widget>
- </item>
- <item row="13" column="0">
- <widget class="QLabel" name="URStaticLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> <span style=" font-weight:600;">Top Right :</span></p></body></html></string>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
</property>
</widget>
</item>
- <item row="13" column="1">
- <widget class="QLabel" name="URLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="14" column="0">
- <widget class="QLabel" name="DLStaticLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;"> Bottom Left : </span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="14" column="1">
- <widget class="QLabel" name="DLLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="15" column="0">
- <widget class="QLabel" name="DRStaticLabel">
+ <item row="12" column="0">
+ <widget class="QLabel" name="TransformationStaticLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
</sizepolicy>
</property>
<property name="text">
- <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;"> Bottom Right :</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="15" column="1">
- <widget class="QLabel" name="DRLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Transformation Matrix:</span></p></body></html></string>
</property>
</widget>
</item>
#include "clitkMemoryUsage.h"
//------------------------------------------------------------------------------
+void vvInfoPanel::setTransformation(QString text)
+{
+ transformationLabel->setText(text);
+}
+
+//------------------------------------------------------------------------------
+
void vvInfoPanel::setFileName(QString text)
{
if (text.size() > 30)
//------------------------------------------------------------------------------
void vvInfoPanel::setViews(int window, int view, int slice)
-{
+{/*
QString viewString;
switch (view) {
case 0: {
DRLabel->setText(text);
break;
}
- }
+ }*/
}
//------------------------------------------------------------------------------
{
Q_OBJECT
- public:
- vvInfoPanel(QWidget * parent=0):QWidget(parent) {
- setupUi(this);
- }
- ~vvInfoPanel() {}
-
- void setFileName(QString text);
- void setSizeMM(QString text);
- void setOrigin(QString text);
- void setSpacing(QString text);
- void setNPixel(QString text);
- void setDimension(QString text);
- void setSizePixel(QString text);
- void setCurrentInfo(int visibility, double x, double y, double z, double X, double Y, double Z, double value);
- void setViews(int window, int view, int slice);
- void setMemoryInMb(QString text);
+public:
+ vvInfoPanel(QWidget * parent=0):QWidget(parent) {
+ setupUi(this);
+ }
+ ~vvInfoPanel() {}
+
+ void setTransformation(QString text);
+ void setFileName(QString text);
+ void setSizeMM(QString text);
+ void setOrigin(QString text);
+ void setSpacing(QString text);
+ void setNPixel(QString text);
+ void setDimension(QString text);
+ void setSizePixel(QString text);
+ void setCurrentInfo(int visibility, double x, double y, double z, double X, double Y, double Z, double value);
+ void setViews(int window, int view, int slice);
+ void setMemoryInMb(QString text);
public slots:
#include "vtkPNMWriter.h"
#include "vtkPNGWriter.h"
#include "vtkJPEGWriter.h"
+#include "vtkMatrix4x4.h"
+#include "vtkTransform.h"
// Standard includes
#include <iostream>
+#include <sstream>
+#include <iomanip>
#define COLUMN_TREE 0
#define COLUMN_UL_VIEW 1
std::vector<double> inputSpacing;
std::vector<int> inputSize;
std::vector<double> sizeMM;
+ vtkSmartPointer<vtkMatrix4x4> transformation;
int dimension=0;
QString pixelType;
QString inputSizeInBytes;
sizeMM[i] = inputSize[i]*inputSpacing[i];
NPixel *= inputSize[i];
}
+ transformation = imageSelected->GetTransform()->GetMatrix();
inputSizeInBytes = GetSizeInBytes(imageSelected->GetActualMemorySize()*1000);
} else if (DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString() == "vector") {
vvImage::Pointer imageSelected = mSlicerManagers[index]->GetSlicer(0)->GetVF();
infoPanel->setOrigin(GetVectorDoubleAsString(origin));
infoPanel->setSpacing(GetVectorDoubleAsString(inputSpacing));
infoPanel->setNPixel(QString::number(NPixel)+" ("+inputSizeInBytes+")");
+ infoPanel->setTransformation(Get4x4MatrixDoubleAsString(transformation));
landmarksPanel->SetCurrentLandmarks(mSlicerManagers[index]->GetLandmarks(),
mSlicerManagers[index]->GetSlicer(0)->GetImage()->GetVTKImages().size());
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+QString vvMainWindow::Get4x4MatrixDoubleAsString(vtkSmartPointer<vtkMatrix4x4> matrix)
+{
+ std::ostringstream strmatrix;
+
+ for (unsigned int i = 0; i < 4; i++) {
+ for (unsigned int j = 0; j < 4; j++) {
+ strmatrix.flags(ios::showpos);
+ strmatrix.width(10);
+ strmatrix.precision(3);
+ strmatrix.setf(ios::fixed,ios::floatfield);
+ strmatrix.fill(' ');
+ strmatrix << std::left << matrix->GetElement(i, j);
+ //strmatrix.width(10);
+ strmatrix << " ";
+ }
+ strmatrix << std::endl;
+ }
+ QString result = strmatrix.str().c_str();
+ return result;
+}
+//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
QString vvMainWindow::GetVectorDoubleAsString(std::vector<double> vectorDouble)
{
#include "vvMesh.h"
#include "clitkMemoryUsage.h"
+#include "vtkSmartPointer.h"
+
+
class vvSlicerManager;
class vvHelpDialog;
class vvDocumentation;
class vtkRenderWindowInteractor;
class vtkImageData;
class vtkRenderer;
+class vtkMatrix4x4;
class vvDicomSeriesSelector;
//------------------------------------------------------------------------------
QString GetSizeInBytes(unsigned long size);
QString GetVectorDoubleAsString(std::vector<double> vectorDouble);
QString GetVectorIntAsString(std::vector<int> vectorInt);
+ QString Get4x4MatrixDoubleAsString(vtkSmartPointer<vtkMatrix4x4> matrix);
int GetSlicerIndexFromItem(QTreeWidgetItem* item);
QTreeWidgetItem* GetItemFromSlicerManager(vvSlicerManager* sm);
void SaveScreenshot(vtkImageData* image);