Skip to content

Commit f52395e

Browse files
committed
Merge branch 'welko-develop' into develop
2 parents 2cf5824 + b6f1a3e commit f52395e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3467
-1888
lines changed

core/src/dlg_modalities.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ dlg_modalities::dlg_modalities(iAFast3DMagicLensWidget* magicLensWidget,
5555

5656
modalities(new iAModalityList),
5757
m_magicLensWidget(magicLensWidget),
58-
m_mainRenderer(mainRenderer),
59-
m_showSlicers(false),
60-
m_plane1(nullptr),
61-
m_plane2(nullptr),
62-
m_plane3(nullptr)
58+
m_mainRenderer(mainRenderer)
6359
{
6460
connect(pbAdd, SIGNAL(clicked()), this, SLOT(AddClicked()));
6561
connect(pbRemove, SIGNAL(clicked()), this, SLOT(RemoveClicked()));
@@ -101,7 +97,7 @@ bool CanHaveMultipleChannels(QString const & fileName)
10197
void dlg_modalities::AddClicked()
10298
{
10399
QString fileName = QFileDialog::getOpenFileName(this, tr("Load"),
104-
"",
100+
modalities->size() > 0 ? QFileInfo(modalities->Get(0)->GetFileName()).absolutePath() : "",
105101
iAIOProvider::GetSupportedLoadFormats() + tr("Volume Stack (*.volstack);;"));
106102
if (fileName.isEmpty())
107103
return;
@@ -406,9 +402,8 @@ void dlg_modalities::RendererMouseMoved()
406402
}
407403
}
408404

409-
void dlg_modalities::ShowSlicers(bool enabled)
405+
void dlg_modalities::ShowSlicers(bool enabled, vtkPlane* plane1, vtkPlane* plane2, vtkPlane* plane3)
410406
{
411-
m_showSlicers = enabled;
412407
for (int i = 0; i < modalities->size(); ++i)
413408
{
414409
QSharedPointer<iAVolumeRenderer> renderer = modalities->Get(i)->GetRenderer();
@@ -419,7 +414,7 @@ void dlg_modalities::ShowSlicers(bool enabled)
419414
}
420415
if (enabled)
421416
{
422-
renderer->SetCuttingPlanes(m_plane1, m_plane2, m_plane3);
417+
renderer->SetCuttingPlanes(plane1, plane2, plane3);
423418
}
424419
else
425420
{
@@ -428,13 +423,6 @@ void dlg_modalities::ShowSlicers(bool enabled)
428423
}
429424
}
430425

431-
void dlg_modalities::SetSlicePlanes(vtkPlane* plane1, vtkPlane* plane2, vtkPlane* plane3)
432-
{
433-
m_plane1 = plane1;
434-
m_plane2 = plane2;
435-
m_plane3 = plane3;
436-
}
437-
438426
void dlg_modalities::AddModality(vtkSmartPointer<vtkImageData> img, QString const & name)
439427
{
440428
QSharedPointer<iAModality> newModality(new iAModality(name, "", -1, img, iAModality::MainRenderer));

core/src/dlg_modalities.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ class open_iA_Core_API dlg_modalities : public dlg_modalitiesUI
6060
vtkSmartPointer<vtkColorTransferFunction> GetCTF(int modality);
6161
vtkSmartPointer<vtkPiecewiseFunction> GetOTF(int modality);
6262
void ChangeRenderSettings(iAVolumeSettings const & rs, const bool loadSavedVolumeSettings);
63-
void ShowSlicers(bool enabled);
64-
void SetSlicePlanes(vtkPlane* plane1, vtkPlane* plane2, vtkPlane* plane3);
63+
void ShowSlicers(bool enabled, vtkPlane* plane1, vtkPlane* plane2, vtkPlane* plane3);
6564
void AddListItem(QSharedPointer<iAModality> mod);
6665
//! initialize a modality's display in renderers
6766
void InitDisplay(QSharedPointer<iAModality> mod);
@@ -96,8 +95,6 @@ private slots:
9695
QSharedPointer<iAModalityList> modalities;
9796
QString m_FileName;
9897
iAFast3DMagicLensWidget* m_magicLensWidget;
99-
bool m_showSlicers;
100-
vtkPlane *m_plane1, *m_plane2, *m_plane3;
10198
vtkRenderer* m_mainRenderer;
10299

103100
void AddToList(QSharedPointer<iAModality> mod);

core/src/iAChannelVisualizationData.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ class open_iA_Core_API iAChannelSlicerData
7878
void SetShowContours( bool show );
7979
void SetContourLineParams( double lineWidth, bool dashed = false );
8080
// }
81+
82+
vtkScalarsToColors* m_ctf;
83+
vtkPiecewiseFunction* m_otf;
84+
vtkSmartPointer<vtkLookupTable> m_lut;
85+
8186
private:
8287
iAChannelSlicerData(iAChannelSlicerData const & other);
8388

@@ -90,10 +95,10 @@ class open_iA_Core_API iAChannelSlicerData
9095
vtkImageMapToColors* colormapper;
9196
bool m_isInitialized;
9297
QColor color;
93-
vtkSmartPointer<vtkLookupTable> m_lut;
98+
//vtkSmartPointer<vtkLookupTable> m_lut;
9499

95-
vtkScalarsToColors* m_ctf;
96-
vtkPiecewiseFunction* m_otf;
100+
//vtkScalarsToColors* m_ctf;
101+
//vtkPiecewiseFunction* m_otf;
97102
QString m_name;};
98103

99104

core/src/iAModuleInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ bool iAModuleInterface::AttachToMdiChild( MdiChild * child )
193193
connect ( attachment, SIGNAL( detach() ), this, SLOT (detach() ) );
194194
}
195195
catch( itk::ExceptionObject &excep )
196-
{
196+
{ // check why we catch an ITK exception here! in the attachment initialization, no ITK filters should be called...
197197
child->addMsg( tr("%1 in File %2, Line %3").arg( excep.GetDescription() )
198198
.arg( excep.GetFile() )
199199
.arg( excep.GetLine() ) );

core/src/iASettings.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* ************************************************************************************/
2121
#include "iASettings.h"
2222

23+
#include <iAConsole.h>
2324
#include "dlg_transfer.h"
2425

2526
#include <vtkPiecewiseFunction.h>
@@ -75,7 +76,10 @@ void iASettings::LoadTransferFunction(QDomNode const & functionsNode, iATransfer
7576
{
7677
QDomNode transferNode = functionsNode.namedItem("transfer");
7778
if (!transferNode.isElement())
79+
{
80+
DEBUG_LOG("'transfer' node not found in given XML file, aborting load of transfer function!");
7881
return;
82+
}
7983
transferFunction->getOpacityFunction()->RemoveAllPoints();
8084
transferFunction->getColorFunction()->RemoveAllPoints();
8185
QDomNodeList list = transferNode.childNodes();

core/src/iASlicer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ class open_iA_Core_API iASlicer : public QObject
108108
void setPositionMarkerCenter(double x, double y);
109109
void SetROIVisible(bool isVisible);
110110
void UpdateROI(int const roi[6]);
111-
void update();
112111
void saveMovie(QString& fileName, int qual = 2);
113112
void saveImageStack();
114113
vtkImageReslice * GetReslicer() const;
@@ -147,6 +146,7 @@ public slots:
147146
void rotateSlice( double angle );
148147
void setSlabThickness(int thickness);
149148
void setSlabCompositeMode(int compositeMode);
149+
void update();
150150

151151
protected:
152152
iASlicerData * m_data;

core/src/iAVolumeRenderer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ const iAVolumeSettings& iAVolumeRenderer::getVolumeSettings() const
108108
return m_VolSettings;
109109
}
110110

111+
bool iAVolumeRenderer::isRendered() const
112+
{
113+
return currentRenderer;
114+
}
115+
111116
void iAVolumeRenderer::ApplySettings(iAVolumeSettings const & vs)
112117
{
113118
if (m_isFlat)

core/src/iAVolumeRenderer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class open_iA_Core_API iAVolumeRenderer
7070
void SetMovable(bool movable);
7171

7272
const iAVolumeSettings& getVolumeSettings() const;
73+
bool isRendered() const;
7374
private:
7475
iAVolumeSettings m_VolSettings;
7576
vtkSmartPointer<vtkVolume> volume;

core/src/mainwindow.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,10 @@ void MainWindow::updateMenus()
16551655
actionDeletePoint->setEnabled(true);
16561656
actionChangeColor->setEnabled(true);
16571657
}
1658+
// set current application working directory to the one where the file is in (as default directory, e.g. for file open)
1659+
// see also MdiChild::setCurrentFile
1660+
if (!activeMdiChild()->getFilePath().isEmpty())
1661+
QDir::setCurrent(activeMdiChild()->getFilePath());
16581662
//??if (activeMdiChild())
16591663
// histogramToolbar->setEnabled(activeMdiChild()->getTabIndex() == 1 && !activeMdiChild()->isMaximized());
16601664
}

core/src/mdichild.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ MdiChild::MdiChild(MainWindow * mainWnd, iAPreferences const & prefs, bool unsav
163163
QSharedPointer<iAModalityList> modList(new iAModalityList);
164164
SetModalities(modList);
165165
splitDockWidget(logs, m_dlgModalities, Qt::Horizontal);
166-
m_dlgModalities->SetSlicePlanes(Raycaster->getPlane1(), Raycaster->getPlane2(), Raycaster->getPlane3());
167166
ApplyViewerPreferences();
168167
imgProperty = nullptr;
169168
imgProfile = nullptr;
@@ -1580,7 +1579,7 @@ void MdiChild::ApplyVolumeSettings(const bool loadSavedVolumeSettings)
15801579
{
15811580
for (int i = 0; i < 3; ++i)
15821581
slicer[i]->widget()->showBorder(renderSettings.ShowSlicePlanes);
1583-
m_dlgModalities->ShowSlicers(renderSettings.ShowSlicers);
1582+
m_dlgModalities->ShowSlicers(renderSettings.ShowSlicers, Raycaster->getPlane1(), Raycaster->getPlane2(), Raycaster->getPlane3());
15841583
m_dlgModalities->ChangeRenderSettings(volumeSettings, loadSavedVolumeSettings);
15851584
}
15861585

@@ -1730,6 +1729,7 @@ bool MdiChild::editSlicerSettings(iASlicerSettings const & slicerSettings)
17301729
setupSlicers(slicerSettings, false);
17311730
for (int s = 0; s<3; ++s)
17321731
slicer[s]->show();
1732+
emit slicerSettingsChanged();
17331733
return true;
17341734
}
17351735

@@ -2286,6 +2286,8 @@ void MdiChild::setCurrentFile(const QString &f)
22862286
fileInfo.setFile(f);
22872287
curFile = f;
22882288
path = fileInfo.canonicalPath();
2289+
if (isActiveWindow())
2290+
QDir::setCurrent(path); // set current application working directory to the one where the file is in (as default directory, e.g. for file open)
22892291
isUntitled = f.isEmpty();
22902292
setWindowTitle(userFriendlyCurrentFile() + "[*]");
22912293
}

0 commit comments

Comments
 (0)