GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoImageInfo.cxx
Go to the documentation of this file.
1 /*=========================================================================
2  Authors: The GoFigure Dev. Team.
3  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
4 
5  Copyright (c) 2009-11, President and Fellows of Harvard College.
6  All rights reserved.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  Redistributions of source code must retain the above copyright notice,
12  this list of conditions and the following disclaimer.
13  Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16  Neither the name of the President and Fellows of Harvard College
17  nor the names of its contributors may be used to endorse or promote
18  products derived from this software without specific prior written
19  permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
25  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 =========================================================================*/
34 
35 #include "QGoImageInfo.h"
36 #include <iostream>
37 
39 {
40  setupUi(this);
41 }
42 
44 {
45 }
46 
48 {
49  if ( ImageInfo->objectName().isEmpty() ) { ImageInfo->setObjectName( QString::fromUtf8("ImageInfo") ); }
50  ImageInfo->resize(293, 315);
51  QSizePolicy tsizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
52  tsizePolicy.setHorizontalStretch(0);
53  tsizePolicy.setVerticalStretch(0);
54  tsizePolicy.setHeightForWidth(
55  ImageInfo->sizePolicy().hasHeightForWidth() );
56  ImageInfo->setSizePolicy(tsizePolicy);
57  verticalLayout = new QVBoxLayout(ImageInfo);
58  verticalLayout->setContentsMargins(3, -1, 3, -1);
59  scrollArea = new QScrollArea(ImageInfo);
62  scrollAreaWidgetContents->setGeometry( QRect(0, 0, 281, 301) );
65  QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed);
66  sizePolicy1.setHorizontalStretch(0);
67  sizePolicy1.setVerticalStretch(0);
68  sizePolicy1.setHeightForWidth( TImageStaticlabel->sizePolicy().hasHeightForWidth() );
69  TImageStaticlabel->setSizePolicy(sizePolicy1);
70 
72 
74 
75  gridLayout->addWidget(TImageLabel, 0, 1, 1, 1);
76 
78  sizePolicy1.setHeightForWidth( DimensionStaticLabel->sizePolicy().hasHeightForWidth() );
79  DimensionStaticLabel->setSizePolicy(sizePolicy1);
80 
82 
84  QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Preferred);
85  sizePolicy2.setHorizontalStretch(0);
86  sizePolicy2.setVerticalStretch(0);
87  sizePolicy2.setHeightForWidth( DimensionLabel->sizePolicy().hasHeightForWidth() );
88  DimensionLabel->setSizePolicy(sizePolicy2);
89 
90  gridLayout->addWidget(DimensionLabel, 1, 1, 1, 1);
91 
93  sizePolicy1.setHeightForWidth( ChannelStaticLabel->sizePolicy().hasHeightForWidth() );
94  ChannelStaticLabel->setSizePolicy(sizePolicy1);
95 
97 
99  sizePolicy2.setHeightForWidth( ChannelLabel->sizePolicy().hasHeightForWidth() );
100  ChannelLabel->setSizePolicy(sizePolicy2);
101 
102  gridLayout->addWidget(ChannelLabel, 2, 1, 1, 1);
103 
105  sizePolicy1.setHeightForWidth( SpacingStaticLabel->sizePolicy().hasHeightForWidth() );
106  SpacingStaticLabel->setSizePolicy(sizePolicy1);
107 
109 
111  sizePolicy2.setHeightForWidth( SpacingLabel->sizePolicy().hasHeightForWidth() );
112  SpacingLabel->setSizePolicy(sizePolicy2);
113 
114  gridLayout->addWidget(SpacingLabel, 4, 1, 1, 1);
115 
117 
118  gridLayout->addWidget(PPositionLabel, 7, 1, 1, 1);
119 
121  QSizePolicy sizePolicy3(QSizePolicy::Preferred, QSizePolicy::Fixed);
122  sizePolicy3.setHorizontalStretch(0);
123  sizePolicy3.setVerticalStretch(0);
124  sizePolicy3.setHeightForWidth( WPositionStaticLabel->sizePolicy().hasHeightForWidth() );
125  WPositionStaticLabel->setSizePolicy(sizePolicy3);
126 
128 
130  sizePolicy2.setHeightForWidth( WPositionLabel->sizePolicy().hasHeightForWidth() );
131  WPositionLabel->setSizePolicy(sizePolicy2);
132 
133  gridLayout->addWidget(WPositionLabel, 8, 1, 1, 1);
134 
136  sizePolicy3.setHeightForWidth( TTimeStaticLabel->sizePolicy().hasHeightForWidth() );
137  TTimeStaticLabel->setSizePolicy(sizePolicy3);
138 
139  gridLayout->addWidget(TTimeStaticLabel, 9, 0, 1, 1);
140 
142  sizePolicy2.setHeightForWidth( TTimeLabel->sizePolicy().hasHeightForWidth() );
143  TTimeLabel->setSizePolicy(sizePolicy2);
144 
145  gridLayout->addWidget(TTimeLabel, 9, 1, 1, 1);
146 
148  sizePolicy3.setHeightForWidth( TValueStaticLabel->sizePolicy().hasHeightForWidth() );
149  TValueStaticLabel->setSizePolicy(sizePolicy3);
150 
151  gridLayout->addWidget(TValueStaticLabel, 11, 0, 1, 1);
152 
154 
155  gridLayout->addWidget(TValueLabel, 11, 1, 1, 1);
156 
158  sizePolicy1.setHeightForWidth( ValueStaticLabel->sizePolicy().hasHeightForWidth() );
159  ValueStaticLabel->setSizePolicy(sizePolicy1);
160 
161  gridLayout->addWidget(ValueStaticLabel, 12, 0, 1, 1);
162 
164  sizePolicy2.setHeightForWidth( ValueLabel->sizePolicy().hasHeightForWidth() );
165  ValueLabel->setSizePolicy(sizePolicy2);
166 
167  gridLayout->addWidget(ValueLabel, 12, 1, 1, 1);
168 
170  sizePolicy1.setHeightForWidth( SizeStaticLabel->sizePolicy().hasHeightForWidth() );
171  SizeStaticLabel->setSizePolicy(sizePolicy1);
172 
173  gridLayout->addWidget(SizeStaticLabel, 3, 0, 1, 1);
174 
176  sizePolicy2.setHeightForWidth( SizeLabel->sizePolicy().hasHeightForWidth() );
177  SizeLabel->setSizePolicy(sizePolicy2);
178 
179  gridLayout->addWidget(SizeLabel, 3, 1, 1, 1);
180 
182  sizePolicy3.setHeightForWidth( TimeStaticLabel->sizePolicy().hasHeightForWidth() );
183  TimeStaticLabel->setSizePolicy(sizePolicy3);
184 
185  gridLayout->addWidget(TimeStaticLabel, 10, 0, 1, 1);
186 
188  sizePolicy2.setHeightForWidth( TimeLabel->sizePolicy().hasHeightForWidth() );
189  TimeLabel->setSizePolicy(sizePolicy2);
190 
191  gridLayout->addWidget(TimeLabel, 10, 1, 1, 1);
192 
194  sizePolicy2.setHeightForWidth( TPositionLabel->sizePolicy().hasHeightForWidth() );
195  TPositionLabel->setSizePolicy(sizePolicy2);
196 
197  gridLayout->addWidget(TPositionLabel, 6, 1, 1, 1);
198 
200  sizePolicy1.setHeightForWidth( TPositionStaticLabel->sizePolicy().hasHeightForWidth() );
201  TPositionStaticLabel->setSizePolicy(sizePolicy1);
202 
204 
206  sizePolicy1.setHeightForWidth( MemoryStaticLabel->sizePolicy().hasHeightForWidth() );
207  MemoryStaticLabel->setSizePolicy(sizePolicy1);
208 
209  gridLayout->addWidget(MemoryStaticLabel, 5, 0, 1, 1);
210 
212  sizePolicy2.setHeightForWidth( MemoryLabel->sizePolicy().hasHeightForWidth() );
213  MemoryLabel->setSizePolicy(sizePolicy2);
214 
215  gridLayout->addWidget(MemoryLabel, 5, 1, 1, 1);
216 
218  sizePolicy3.setHeightForWidth( PPositionStaticLabel->sizePolicy().hasHeightForWidth() );
219  PPositionStaticLabel->setSizePolicy(sizePolicy3);
220 
222 
224 
226 
227  retranslateUi(ImageInfo);
228 
230 } // setupUi
231 
233 {
234  Form->setWindowTitle( QApplication::translate("Form", "Form", 0, QApplication::UnicodeUTF8) );
236  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
237  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
238  "p, li { white-space: pre-wrap; }\n"
239  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
240  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
241  "<span style=\" font-weight:600; color:#0000ff;\">Image :</span></p></body></html>",
242  0, QApplication::UnicodeUTF8) );
244  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
245  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
246  "p, li { white-space: pre-wrap; }\n"
247  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
248  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
249  "<span style=\" font-size:9pt; font-weight:600;\"> Dimension :</span></p></body></html>",
250  0, QApplication::UnicodeUTF8) );
253  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
254  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
255  "p, li { white-space: pre-wrap; }\n"
256  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
257  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
258  "<span style=\" font-size:9pt; font-weight:600;\"> Size :</span></p></body></html>",
259  0, QApplication::UnicodeUTF8) );
260  SizeLabel->setText( QString() );
265  TimeLabel->setText( QString() );
267  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
268  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
269  "p, li { white-space: pre-wrap; }\n"
270  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
271  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
272  "<span style=\" font-size:9pt; font-weight:600;\"> Spacing :</span></p></body></html>",
273  0, QApplication::UnicodeUTF8) );
275  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
276  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
277  "p, li { white-space: pre-wrap; }\n"
278  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
279  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
280  "<span style=\" font-size:9pt; font-weight:600;\"> Memory :</span></p></body></html>",
281  0, QApplication::UnicodeUTF8) );
283  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
284  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
285  "p, li { white-space: pre-wrap; }\n"
286  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
287  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
288  "<span style=\" font-weight:600; color:#0000ff;\">Position :</span></p></body></html>",
289  0, QApplication::UnicodeUTF8) );
291  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
292  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
293  "p, li { white-space: pre-wrap; }\n"
294  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
295  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
296  "<span style=\" font-size:9pt; font-weight:600;\"> Position (pixel) :</span></p></body></html>",
297  0, QApplication::UnicodeUTF8) );
299  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
300  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
301  "p, li { white-space: pre-wrap; }\n"
302  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
303  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
304  "<span style=\" font-size:9pt; font-weight:600;\"> Position (um) :</span></p></body></html>",
305  0, QApplication::UnicodeUTF8) );
307  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
308  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
309  "p, li { white-space: pre-wrap; }\n"
310  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
311  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
312  "<span style=\" font-size:9pt; font-weight:600;\"> # Channels : </span></p></body></html>",
313  0, QApplication::UnicodeUTF8) );
315  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
316  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
317  "p, li { white-space: pre-wrap; }\n"
318  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
319  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
320  "<span style=\" font-weight:600; color:#0000ff;\">Time :</span></p></body></html>",
321  0, QApplication::UnicodeUTF8) );
323  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
324  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
325  "p, li { white-space: pre-wrap; }\n"
326  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
327  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
328  "<span style=\" font-weight:600; color:#0000ff;\">Value :</span></p></body></html>",
329  0, QApplication::UnicodeUTF8) );
331  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
332  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
333  "p, li { white-space: pre-wrap; }\n"
334  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
335  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
336  "<span style=\" font-size:9pt; font-weight:600;\"> Pixel value :</span></p></body></html>",
337  0, QApplication::UnicodeUTF8) );
338  ValueLabel->setText( QString() );
341  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
342  "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
343  "p, li { white-space: pre-wrap; }\n"
344  "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
345  "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
346  "<span style=\" font-size:9pt; font-weight:600;\"> Time Point :</span></p></body></html>",
347  0, QApplication::UnicodeUTF8) );
348  Q_UNUSED(Form);
349 } // retranslateUi
350 
351 void QGoImageInfo::setDimension(const unsigned int & dim)
352 {
353  m_Dimension = dim;
354  this->DimensionLabel->setText( QString("%1").arg(m_Dimension) );
355  m_Size.resize(dim);
356  m_Spacing.resize(dim);
357 
358  bool space_time = ( dim > 3 );
359  this->TTimeStaticLabel->setVisible(space_time);
360  this->TTimeLabel->setVisible(space_time);
361  this->TimeStaticLabel->setVisible(space_time);
362  this->TimeLabel->setVisible(space_time);
363 
364  if ( space_time )
365  {
366  m_PPos.resize(3);
367  m_WPos.resize(3);
368  }
369  else
370  {
371  m_PPos.resize(dim);
372  m_WPos.resize(dim);
373  }
374 }
375 
376 void QGoImageInfo::setNumberOfChannels(const unsigned int & channel)
377 {
378  m_Channel = channel;
379  this->ChannelLabel->setText( QString("%1").arg(m_Channel) );
380 
381  m_Value.resize(m_Channel);
382 }
383 
384 void QGoImageInfo::setMemory(const unsigned long & iMem)
385 {
386  m_Memory = iMem;
387 
388  if ( static_cast< double >( m_Memory ) > 1e12 )
389  {
390  this->MemoryLabel->setText( QString("%1 TB").arg(1e-12 * static_cast< double >( m_Memory ), 0, 'g', 3) );
391  }
392  else
393  {
394  if ( static_cast< double >( m_Memory ) > 1e9 )
395  {
396  this->MemoryLabel->setText( QString("%1 GB").arg(1e-9 * static_cast< double >( m_Memory ), 0, 'g', 3) );
397  }
398  else
399  {
400  if ( static_cast< double >( m_Memory ) > 1e6 )
401  {
402  this->MemoryLabel->setText( QString("%1 MB").arg(1e-6 * static_cast< double >( m_Memory ), 0, 'g', 3) );
403  }
404  else
405  {
406  if ( static_cast< double >( m_Memory ) > 1e3 )
407  {
408  this->MemoryLabel->setText( QString("%1 KB").arg(1e-3 * static_cast< double >( m_Memory ), 0, 'g', 3) );
409  }
410  else
411  {
412  this->MemoryLabel->setText( QString("%1").arg(m_Memory) );
413  }
414  }
415  }
416  }
417 }
418 
419 void QGoImageInfo::setSize(const std::vector< unsigned int > & iSize)
420 {
421  if ( !m_Size.empty() )
422  {
423  if ( iSize.size() == m_Dimension )
424  {
425  m_Size = iSize;
427  }
428  else
429  {
430  std::cout << "iSize.size() != " << m_Dimension << std::endl;
431  }
432  }
433  else
434  {
435  std::cout << "Please setDimension first!" << std::endl;
436  }
437 }
438 
439 void QGoImageInfo::setSpacing(const std::vector< float > & iSpacing)
440 {
441  if ( !m_Spacing.empty() )
442  {
443  if ( iSpacing.size() == m_Dimension )
444  {
445  m_Spacing = iSpacing;
447  }
448  else
449  {
450  std::cout << "iSpacing.size() != " << m_Dimension << std::endl;
451  }
452  }
453  else
454  {
455  std::cout << "Please setDimension first!" << std::endl;
456  }
457 }
458 
459 void QGoImageInfo::setPixelPosition(const std::vector< unsigned int > & iPos)
460 {
461  if ( !m_PPos.empty() )
462  {
463  unsigned int len = ( m_Dimension > 3 ) ? 3 : m_Dimension;
464  if ( iPos.size() == len )
465  {
466  m_PPos = iPos;
468  }
469  else
470  {
471  std::cout << "iPos.size() != " << len << std::endl;
472  }
473  }
474  else
475  {
476  std::cout << "Please setDimension first!" << std::endl;
477  }
478 }
479 
480 void QGoImageInfo::setWorldPosition(const std::vector< float > & iPos)
481 {
482  if ( !m_WPos.empty() )
483  {
484  unsigned int len = ( m_Dimension > 3 ) ? 3 : m_Dimension;
485  if ( iPos.size() == len )
486  {
487  m_WPos = iPos;
489  }
490  else
491  {
492  std::cout << "iPos.size() != " << len << std::endl;
493  }
494  }
495  else
496  {
497  std::cout << "Please setDimension first!" << std::endl;
498  }
499 }
500 
501 void QGoImageInfo::setTimePoint(const float & iTime)
502 {
503  m_TimePoint = iTime;
504  this->TimeLabel->setText( QString("%1").arg(m_TimePoint) );
505 }
506 
507 void QGoImageInfo::setValue(const std::vector< float > & iVal)
508 {
509  QString val;
510 
511  if ( !m_Value.empty() )
512  {
513  if ( iVal.size() == m_Channel )
514  {
515  m_Value = iVal;
517  }
518  else
519  {
520  std::cout << "iVal.size() != " << m_Channel << std::endl;
521  }
522  }
523  else
524  {
525  std::cout << "Please setDimension first!" << std::endl;
526  }
527 }
void setVerticalStretch(uchar stretchFactor)
QLabel * TPositionStaticLabel
Definition: QGoImageInfo.h:103
QLabel * ValueStaticLabel
Definition: QGoImageInfo.h:96
void setWidget(QWidget *widget)
void setContentsMargins(int left, int top, int right, int bottom)
QGridLayout * gridLayout
Definition: QGoImageInfo.h:79
QLabel * ChannelLabel
Definition: QGoImageInfo.h:86
QLabel * TImageStaticlabel
Definition: QGoImageInfo.h:81
void addWidget(QWidget *widget, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
QLabel * SizeStaticLabel
Definition: QGoImageInfo.h:98
QLabel * ValueLabel
Definition: QGoImageInfo.h:97
QLabel * DimensionStaticLabel
Definition: QGoImageInfo.h:83
virtual ~QGoImageInfo()
QLabel * MemoryLabel
Definition: QGoImageInfo.h:105
unsigned int m_Dimension
Definition: QGoImageInfo.h:108
QLabel * TValueStaticLabel
Definition: QGoImageInfo.h:94
QLabel * SpacingStaticLabel
Definition: QGoImageInfo.h:87
virtual void setVisible(bool visible)
QLabel * TPositionLabel
Definition: QGoImageInfo.h:102
unsigned int m_Channel
Definition: QGoImageInfo.h:109
QVBoxLayout * verticalLayout
Definition: QGoImageInfo.h:76
void setNumberOfChannels(const unsigned int &)
QLabel * TimeLabel
Definition: QGoImageInfo.h:101
QString ConvertToQString(const TContainer &iVector)
Definition: QGoImageInfo.h:120
std::vector< float > m_Spacing
Definition: QGoImageInfo.h:113
void setupUi(QWidget *Form)
void setGeometry(int x, int y, int w, int h)
void retranslateUi(QWidget *Form)
void resize(int w, int h)
QLabel * ChannelStaticLabel
Definition: QGoImageInfo.h:85
QLabel * SizeLabel
Definition: QGoImageInfo.h:99
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
unsigned long m_Memory
Definition: QGoImageInfo.h:110
QLabel * PPositionLabel
Definition: QGoImageInfo.h:89
QString fromUtf8(const char *str, int size)
QLabel * DimensionLabel
Definition: QGoImageInfo.h:84
QLabel * PPositionStaticLabel
Definition: QGoImageInfo.h:106
void setDimension(const unsigned int &)
QLabel * TImageLabel
Definition: QGoImageInfo.h:82
void setText(const QString &)
QLabel * TimeStaticLabel
Definition: QGoImageInfo.h:100
QLabel * TTimeLabel
Definition: QGoImageInfo.h:93
QLabel * SpacingLabel
Definition: QGoImageInfo.h:88
void setSpacing(const std::vector< float > &)
QLabel * WPositionLabel
Definition: QGoImageInfo.h:91
void setWidgetResizable(bool resizable)
QLabel * WPositionStaticLabel
Definition: QGoImageInfo.h:90
std::vector< unsigned int > m_PPos
Definition: QGoImageInfo.h:114
QLabel * TValueLabel
Definition: QGoImageInfo.h:95
std::vector< float > m_Value
Definition: QGoImageInfo.h:116
QWidget * scrollAreaWidgetContents
Definition: QGoImageInfo.h:78
std::vector< float > m_WPos
Definition: QGoImageInfo.h:115
void setPixelPosition(const std::vector< unsigned int > &)
void setWindowTitle(const QString &)
QWidget(QWidget *parent, QFlags< Qt::WindowType > f)
void setMemory(const unsigned long &)
QScrollArea * scrollArea
Definition: QGoImageInfo.h:77
QString translate(const char *context, const char *sourceText, const char *disambiguation, Encoding encoding)
std::vector< unsigned int > m_Size
Definition: QGoImageInfo.h:112
void setHorizontalStretch(uchar stretchFactor)
void setSize(const std::vector< unsigned int > &)
float m_TimePoint
Definition: QGoImageInfo.h:117
void setValue(const std::vector< float > &)
void setTimePoint(const float &)
QLabel * MemoryStaticLabel
Definition: QGoImageInfo.h:104
QGoImageInfo(QWidget *parent=0)
void connectSlotsByName(QObject *object)
void setWorldPosition(const std::vector< float > &)
void setHeightForWidth(bool dependent)
QLabel * TTimeStaticLabel
Definition: QGoImageInfo.h:92