Commit e2a9386b authored by fw4splbot's avatar fw4splbot
Browse files

merge(dev): release 13.1.0

parents 2a42ae2d 496f5df8
......@@ -7,8 +7,6 @@
<param name="landmarks" />
<param name="patient_name" default="" />
<param name="orientation" default="axial" /> <!-- axial, frontal, sagittal -->
<param name="ModelRepresentationChannel" />
<param name="ModelDisplayChannel" />
<param name="CrossTypeChannel" default="crossTypeChannel" />
<param name="PickingChannel" default="pickingChannel" />
<param name="setSagittalCameraChannel" />
......@@ -176,14 +174,6 @@
<slot>multiDistances/createDistance</slot>
</connect>
<connect channel="${ModelRepresentationChannel}">
<slot>modelSeries/updateNormalMode</slot>
</connect>
<connect channel="${ModelDisplayChannel}">
<slot>modelSeries/showReconstructions</slot>
</connect>
<connect channel="${PickingChannel}">
<signal>pickerInteractor/picked</signal>
</connect>
......
......@@ -129,8 +129,6 @@
<appConfig id="OrganManagerWithSeries" />
<inout key="ORGAN_MANAGER_MODELSERIES" uid="${modelSeries}" />
<parameter replace="ICON_PATH" by="${ICON_PATH}" />
<parameter replace="ModelRepresentationChannel" by="ModelRepresentationChannel" />
<parameter replace="ModelDisplayChannel" by="ModelDisplayChannel" />
</service>
<service uid="cfgNegato1" type="::fwServices::SConfigController">
......@@ -141,8 +139,6 @@
<parameter replace="orientation" by="axial" />
<parameter replace="WID_PARENT" by="view_negato1" />
<parameter replace="patient_name" by="${patient_name}" />
<parameter replace="ModelRepresentationChannel" by="ModelRepresentationChannel" />
<parameter replace="ModelDisplayChannel" by="ModelDisplayChannel" />
<parameter replace="PickingChannel" by="pickerChannel" />
<parameter replace="CrossTypeChannel" by="crossTypeChannel" />
<parameter replace="setSagittalCameraChannel" by="setSagittalCameraChannel" />
......@@ -292,10 +288,6 @@
<signal>action_AxialViewMPR3D/triggered</signal>
</connect>
<!-- Shared channels between 3DNegatoWithAcq and OrganManagerWithSeries -->
<connect channel="ModelDisplayChannel" />
<connect channel="ModelRepresentationChannel" />
<!-- START AND STOP SERVICES -->
<start uid="mainView" />
<start uid="extractImage" />
......
......@@ -4,8 +4,7 @@
<param name="ORGAN_MANAGER_MODELSERIES" />
<param name="CLOSE_CONFIG_CHANNEL" default="DummyChannel" /><!-- defined by SConfigLauncher -->
<param name="ICON_PATH" />
<param name="ModelRepresentationChannel" />
<param name="ModelDisplayChannel" />
<param name="WindowTitle" default="Organs Manager"/>
</parameters>
<config>
......@@ -17,7 +16,7 @@
<window onclose="notify" />
<gui>
<frame>
<name>Organs Manager</name>
<name>${WindowTitle}</name>
<icon>${ICON_PATH}</icon>
<style mode="STAY_ON_TOP" />
</frame>
......@@ -72,15 +71,6 @@
<signal>organManagerFrame/closed</signal>
</connect>
<connect channel="${ModelDisplayChannel}">
<signal>listOrganEditor/recDisplayModified</signal>
<slot>listOrganEditor/showReconstructions</slot>
</connect>
<connect channel="${ModelRepresentationChannel}">
<signal>representationEditor/normalsModeModified</signal>
</connect>
<!-- START AND STOP SERVICES -->
<start uid="organManagerFrame" />
<start uid="myUpdaterReconst" />
......
......@@ -108,8 +108,6 @@
<appConfig id="OrganManagerWithSeries" />
<inout key="ORGAN_MANAGER_MODELSERIES" uid="optionalModelSeries" />
<parameter replace="ICON_PATH" by="${ICON_PATH}" />
<parameter replace="ModelRepresentationChannel" by="ModelRepresentationChannel" />
<parameter replace="ModelDisplayChannel" by="ModelDisplayChannel" />
</service>
<service uid="ActionSnapshotVR" type="::uiVisu::action::SSnapshot" />
......@@ -230,14 +228,6 @@
<slot>snapshot1/snap</slot>
</connect>
<connect channel="ModelRepresentationChannel">
<slot>modelSeriesAdaptor/updateNormalMode</slot>
</connect>
<connect channel="ModelDisplayChannel">
<slot>modelSeriesAdaptor/showReconstructions</slot>
</connect>
<!-- START AND STOP SERVICES -->
<start uid="computeHistogram" />
<start uid="LockImageSrv" />
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2017.
* FW4SPL - Copyright (C) IRCAD, 2009-2018.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -18,12 +18,12 @@ namespace basicRegistration
/**
* @brief Register a point list against a reference point list. Each point in the list to register is matched
* with a point in the reference list according to its label.
* with a point in the reference list according to their order or to their labels if they have any.
* The output is a transformation matrix.
* @section Signals Signals
* - \b errorComputed(double): emitted when registration error is computed.
* @section Slots Slots
* - \b changeMode(std::string, std::string): called when registration mode is changed.
* - \b changeMode(std::string): called when registration mode is changed.
* Three modes are available : RIGID, SIMILARITY or AFFINE
* @section XML XML Configuration
* @code{.xml}
......@@ -31,6 +31,7 @@ namespace basicRegistration
<inout key="registeredPL" uid="..." />
<inout key="referencePL" uid="..." />
<inout key="output" uid="..." />
<config mode="similarity" />
</service>
@endcode
* @subsection In-Out In-Out
......@@ -38,6 +39,9 @@ namespace basicRegistration
* - \b referencePL [::fwData::PointList]: List containing the reference points to match with the points to register.
* - \b output [::fwData::TransformationMatrix3D]: Transformation matrix between the source and target points.
*
* @subsection Configuration Configuration
* - \b mode (optional, values=rigid|similarity|affine, default=rigid): registration mode.
*
*/
class BASICREGISTRATION_CLASS_API SPointListRegistration : public ::fwServices::IController
{
......@@ -93,7 +97,7 @@ protected:
private:
///SLOT: changeMode
void changeMode(std::string _value, std::string _key);
void changeMode(std::string _value);
/// Key source point list
std::string m_registeredPointsKey;
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2017.
* FW4SPL - Copyright (C) IRCAD, 2009-2018.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -51,6 +51,27 @@ SPointListRegistration::~SPointListRegistration()
void SPointListRegistration::configuring()
{
const ConfigType config = this->getConfigTree().get_child("config.<xmlattr>");
const std::string mode = config.get< std::string >("mode", "rigid");
if(mode == "rigid")
{
m_registrationMode = RIGID;
}
else if(mode == "similarity")
{
m_registrationMode = SIMILARITY;
}
else if(mode == "affine")
{
m_registrationMode = AFFINE;
}
else
{
SLM_ERROR("Unknown registration mode: '" + mode + "', it must be 'rigid', 'similarity' or 'affine'."
" Defaulting to 'rigid'.")
}
}
// ----------------------------------------------------------------------------
......@@ -81,7 +102,12 @@ void SPointListRegistration::updating()
vtkSmartPointer<vtkPoints> sourcePts = vtkSmartPointer<vtkPoints>::New();
vtkSmartPointer<vtkPoints> targetPts = vtkSmartPointer<vtkPoints>::New();
// Match each point in both list according to the label
const auto& firstPoint = referencePL->getCRefPoints()[0];
// If the points have labels ...
if(firstPoint->getField< ::fwData::String >(::fwDataTools::fieldHelper::Image::m_labelId ) != nullptr)
{
// ... Then match them according to that label.
for( ::fwData::Point::sptr pointRef : referencePL->getPoints() )
{
const std::string& labelRef =
......@@ -113,6 +139,22 @@ void SPointListRegistration::updating()
}
}
}
}
else
{
// ... Else match them according to their order.
for(const auto& refPoint : referencePL->getCRefPoints())
{
const auto& coords = refPoint->getRefCoord();
sourcePts->InsertNextPoint(coords[0], coords[1], coords[2]);
}
for(const auto& regPoint : registeredPL->getCRefPoints())
{
const auto& coords = regPoint->getRefCoord();
targetPts->InsertNextPoint(coords[0], coords[1], coords[2]);
}
}
landmarkTransform->SetSourceLandmarks(sourcePts);
landmarkTransform->SetTargetLandmarks(targetPts);
......@@ -135,9 +177,9 @@ void SPointListRegistration::updating()
// Get the resulting transformation matrix (this matrix takes the source points to the target points)
vtkSmartPointer<vtkMatrix4x4> m = landmarkTransform->GetMatrix();
m->Invert();
for(size_t l = 0; l < 4; ++l)
for(std::uint8_t l = 0; l < 4; ++l)
{
for(size_t c = 0; c < 4; ++c)
for(std::uint8_t c = 0; c < 4; ++c)
{
matrix->setCoefficient(l, c, m->GetElement(l, c));
}
......@@ -198,7 +240,7 @@ void SPointListRegistration::swapping()
//----------------------------------------------------------------------------
void SPointListRegistration::changeMode(std::string _value, std::string _key)
void SPointListRegistration::changeMode(std::string _value)
{
if(_value == "RIGID")
{
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2015.
* FW4SPL - Copyright (C) IRCAD, 2009-2017.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......
......@@ -16,6 +16,7 @@
<activate id="Tuto01Basic" />
<activate id="Tuto02DataServiceBasic" />
<start id="visuVTKQt" />
<start id="guiQt" />
</profile>
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2017.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef __UIIO_ACTION_SFOLDERSELECTOR_HPP__
#define __UIIO_ACTION_SFOLDERSELECTOR_HPP__
#include "uiIO/config.hpp"
#include <fwGui/IActionSrv.hpp>
#include <boost/filesystem/path.hpp>
namespace uiIO
{
namespace action
{
/**
* @brief Raise a pop-up dialog to select a directory, then send it via a signal.
*
* @section Signals Signals
* - \b folderSelector(::boost::filesystem::path) : Emitted when the directory is chosen.
*
* @section XML XML Configuration
*
* @code{.xml}
<service type="::uiIO::action::SFolderSelector" >
<dialogTitle>Select a folder</dialogTitle>
</service>
@endcode
* @subsection Configuration Configuration:
* - \b dialogTitle (optional): title of the dialog.
*/
class UIIO_CLASS_API SFolderSelector : public ::fwGui::IActionSrv
{
public:
fwCoreServiceClassDefinitionsMacro( (SFolderSelector)( ::fwGui::IActionSrv) )
/**
* @name Signals API
* @{
*/
typedef ::fwCom::Signal< void ( ::boost::filesystem::path ) > FolderSelectedSignalType;
static const ::fwCom::Signals::SignalKeyType s_FOLDER_SELECTED_SIG;
/// @}
UIIO_API SFolderSelector() noexcept;
UIIO_API virtual ~SFolderSelector() noexcept;
protected:
/// Do nothing
UIIO_API void configuring() override;
/// Do nothing.
UIIO_API void starting() override;
/// Show the dialog and send the signal with the chosen directory
UIIO_API void updating() override;
/// Do nothing.
UIIO_API void stopping() override;
private:
/// Optional title for the dialog
std::string m_dialogTitle;
};
} // namespace action
} // namespace uiIO
#endif // __UIIO_ACTION_SFOLDERSELECTOR_HPP__
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2017.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#include "uiIO/action/SFolderSelector.hpp"
#include <fwCom/Signal.hxx>
#include <fwData/location/Folder.hpp>
#include <fwGui/dialog/LocationDialog.hpp>
#include <fwServices/macros.hpp>
namespace uiIO
{
namespace action
{
fwServicesRegisterMacro( ::fwGui::IActionSrv, ::uiIO::action::SFolderSelector, ::fwData::Object );
const ::fwCom::Signals::SignalKeyType SFolderSelector::s_FOLDER_SELECTED_SIG = "folderSelected";
//------------------------------------------------------------------------------
SFolderSelector::SFolderSelector( ) noexcept
{
newSignal< FolderSelectedSignalType >( s_FOLDER_SELECTED_SIG );
}
//------------------------------------------------------------------------------
SFolderSelector::~SFolderSelector() noexcept
{
}
//------------------------------------------------------------------------------
void SFolderSelector::configuring()
{
const auto& config = this->getConfigTree();
m_dialogTitle = config.get("dialogTitle", "Select a folder");
}
//------------------------------------------------------------------------------
void SFolderSelector::starting()
{
}
//------------------------------------------------------------------------------
void SFolderSelector::updating( )
{
static ::boost::filesystem::path _sDefaultPath("");
::fwGui::dialog::LocationDialog dialogFile;
dialogFile.setTitle(m_dialogTitle);
dialogFile.setDefaultLocation( ::fwData::location::Folder::New(_sDefaultPath) );
dialogFile.setOption(::fwGui::dialog::ILocationDialog::READ);
dialogFile.setType(::fwGui::dialog::ILocationDialog::FOLDER);
::fwData::location::Folder::sptr result;
result = ::fwData::location::Folder::dynamicCast( dialogFile.show() );
if (result)
{
auto sig = this->signal<FolderSelectedSignalType>(s_FOLDER_SELECTED_SIG);
sig->asyncEmit(result->getFolder());
}
}
//------------------------------------------------------------------------------
void SFolderSelector::stopping()
{
}
//------------------------------------------------------------------------------
//
} // namespace action
} // namespace uiIO
......@@ -99,17 +99,12 @@ protected:
*/
virtual void configuring() override;
/// Overrides
virtual void info( std::ostream& _sstream ) override;
typedef std::map< std::string, ValueView* > DisplayedInformation;
void updateReconstructions();
void fillTree();
static const ::fwCom::Signals::SignalKeyType s_REC_DISPLAY_MODIFIED__SIG;
typedef ::fwCom::Signal< void (bool) > RecDisplayModifiedSignalType;
static const ::fwCom::Signals::SignalKeyType s_RECONSTRUCTION_SELECTED_SIG;
typedef ::fwCom::Signal< void (::fwData::Object::sptr) > ReconstructionSelectedSignalType;
static const ::fwCom::Signals::SignalKeyType s_EMPTIED_SELECTION_SIG;
......@@ -149,9 +144,6 @@ private:
bool m_enableHideAll;
/// Signal emitted when m_showCheckBox value changed
RecDisplayModifiedSignalType::sptr m_sigRecDisplayModified;
/// Signal emitted when a reconstruction is selected
ReconstructionSelectedSignalType::sptr m_sigReconstructionSelected;
......
......@@ -122,13 +122,14 @@ void SActivityWizard::configuring()
for(::fwRuntime::ConfigurationElement::sptr elt : cfg)
{
std::string type = elt->getAttributeValue("type");
const std::string type = elt->getAttributeValue("type");
SLM_ASSERT("'series' attribute is missing", !type.empty());
std::string icon = elt->getAttributeValue("icon");
const std::string icon = elt->getAttributeValue("icon");
SLM_ASSERT("'icon' attribute is missing", !icon.empty());
m_objectIcons[type] = icon;
const auto file = ::fwRuntime::getResourceFilePath(icon);
m_objectIcons[type] = file.string();
}
}
}
......
......@@ -24,6 +24,8 @@
#include <fwDataCamp/getObject.hpp>
#include <fwDataTools/helper/Field.hpp>
#include <fwGuiQt/container/QtContainer.hpp>
#include <fwMedData/ModelSeries.hpp>
......@@ -124,7 +126,6 @@ public:
fwServicesRegisterMacro( ::gui::editor::IEditor, ::uiMedDataQt::editor::SModelSeriesList, ::fwMedData::ModelSeries);
const ::fwCom::Signals::SignalKeyType SModelSeriesList::s_REC_DISPLAY_MODIFIED__SIG = "recDisplayModified";
const ::fwCom::Signals::SignalKeyType SModelSeriesList::s_RECONSTRUCTION_SELECTED_SIG = "reconstructionSelected";
const ::fwCom::Signals::SignalKeyType SModelSeriesList::s_EMPTIED_SELECTION_SIG = "emptiedSelection";
const ::fwCom::Slots::SlotKeyType SModelSeriesList::s_SHOW_RECONSTRUCTIONS_SLOT = "showReconstructions";
......@@ -133,7 +134,6 @@ SModelSeriesList::SModelSeriesList() noexcept :
m_tree(new QTreeWidget()),
m_enableHideAll(true)
{
m_sigRecDisplayModified = newSignal< RecDisplayModifiedSignalType >( s_REC_DISPLAY_MODIFIED__SIG );
m_sigReconstructionSelected = newSignal< ReconstructionSelectedSignalType >( s_RECONSTRUCTION_SELECTED_SIG );
m_sigEmptiedSelection = newSignal< EmptiedSelectionSignalType >( s_EMPTIED_SELECTION_SIG );
......@@ -275,12 +275,6 @@ void SModelSeriesList::swapping()
//------------------------------------------------------------------------------
void SModelSeriesList::info( std::ostream& _sstream )
{
}
//------------------------------------------------------------------------------
void SModelSeriesList::updateReconstructions()
{
::fwGuiQt::container::QtContainer::sptr qtContainer
......@@ -342,7 +336,7 @@ void SModelSeriesList::fillTree()
//------------------------------------------------------------------------------
void SModelSeriesList::onCurrentItemChanged( QTreeWidgetItem* current, QTreeWidgetItem* previous )
void SModelSeriesList::onCurrentItemChanged( QTreeWidgetItem* current, QTreeWidgetItem* )
{
SLM_ASSERT( "Current selected item is null", current );
std::string id = current->data(0, Qt::UserRole).toString().toStdString();
......@@ -361,7 +355,7 @@ void SModelSeriesList::onCurrentItemChanged ( QTreeWidgetItem* current, int colu
//------------------------------------------------------------------------------
void SModelSeriesList::onOrganChoiceVisibility(QTreeWidgetItem* item, int column)
void SModelSeriesList::onOrganChoiceVisibility(QTreeWidgetItem* item, int )
{
std::string id = item->data(0, Qt::UserRole).toString().toStdString();
::fwData::Reconstruction::sptr rec = ::fwData::Reconstruction::dynamicCast(::fwTools::fwID::getObject(id));
......@@ -391,10 +385,10 @@ void SModelSeriesList::onShowReconstructions(int state )
m_tree->setEnabled(!visible);
::fwMedData::ModelSeries::sptr modelSeries = this->getObject< ::fwMedData::ModelSeries >();
modelSeries->setField("ShowReconstructions", ::fwData::Boolean::New(state == Qt::Unchecked) );
::fwCom::Connection::Blocker block(m_sigRecDisplayModified->getConnection(m_slotShowReconstuctions));
m_sigRecDisplayModified->asyncEmit(state == Qt::Unchecked);
{
::fwDataTools::helper::Field helper( modelSeries );
helper.addOrSwap("ShowReconstructions", ::fwData::Boolean::New(state == Qt::Unchecked));
}
}
//------------------------------------------------------------------------------
......
......@@ -28,6 +28,8 @@
#include <fwMedDataTools/helper/SeriesDB.hpp>
#include <fwRuntime/operations.hpp>
#include <fwServices/macros.hpp>
#include <QVBoxLayout>
......@@ -216,13 +218,14 @@ void SSelector::configuring()
for(::fwRuntime::ConfigurationElement::sptr elt : cfg)
{
std::string series = elt->getAttributeValue("series");
const std::string series = elt->getAttributeValue("series");
SLM_ASSERT("'series' attribute is missing", !series.empty());
std::string icon = elt->getAttributeValue("icon");
const std::string icon = elt->getAttributeValue("icon");
SLM_ASSERT("'icon' attribute is missing", !icon.empty());
m_seriesIcons[series] = icon;
const auto file = ::fwRuntime::getResourceFilePath(icon);
m_seriesIcons[series] = file.string();
}
}
}
......
......@@ -72,9 +72,6 @@ protected:
virtual void configuring() override;
/// Overrides
virtual void info( std::ostream& _sstream ) override;
void notifyMaterial();
protected Q_SLOTS:
......@@ -95,9 +92,6 @@ private:
::fwData::Material::sptr m_material;