Skip to content

Commit

Permalink
Merge pull request #41 from Inria-Visages/noddi
Browse files Browse the repository at this point in the history
Noddi
  • Loading branch information
ocommowi authored Jun 14, 2018
2 parents c06a6b3 + 6f01376 commit 8bb0677
Show file tree
Hide file tree
Showing 19 changed files with 1,227 additions and 101 deletions.
2 changes: 1 addition & 1 deletion Anima/cmake/AnimaDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ else()
endif()

# Boost
find_package(Boost 1.40.0 REQUIRED)
find_package(Boost 1.66.0 REQUIRED)

# TCLAP
option(BUILD_TOOLS "Build command line executables" ON)
Expand Down
34 changes: 32 additions & 2 deletions Anima/diffusion/mcm/animaMultiCompartmentModelCreator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <animaFreeWaterCompartment.h>
#include <animaIsotropicRestrictedWaterCompartment.h>
#include <animaNODDICompartment.h>
#include <animaStationaryWaterCompartment.h>
#include <animaStickCompartment.h>
#include <animaTensorCompartment.h>
Expand Down Expand Up @@ -132,6 +133,10 @@ MultiCompartmentModelCreator::MCMPointer MultiCompartmentModelCreator::GetNewMul
case Tensor:
this->CreateTensorCompartment(tmpPointer,applyCommonConstraints);
break;

case NODDI:
this->CreateNODDICompartment(tmpPointer,applyCommonConstraints);
break;

case DDI:
this->CreateDDICompartment(tmpPointer,applyCommonConstraints);
Expand Down Expand Up @@ -161,7 +166,7 @@ void MultiCompartmentModelCreator::CreateStickCompartment(BaseCompartmentPointer

stickComp->SetAxialDiffusivity(m_AxialDiffusivity);
stickComp->SetRadialDiffusivity1((m_RadialDiffusivity1 + m_RadialDiffusivity2) / 2.0);

if (applyConstraints)
{
if (m_UseCommonDiffusivities)
Expand All @@ -180,7 +185,6 @@ void MultiCompartmentModelCreator::CreateZeppelinCompartment(BaseCompartmentPoin

zepComp->SetAxialDiffusivity(m_AxialDiffusivity);
zepComp->SetRadialDiffusivity1((m_RadialDiffusivity1 + m_RadialDiffusivity2) / 2.0);
zepComp->SetRadialDiffusivity2(m_RadialDiffusivity2);

if (applyConstraints)
{
Expand Down Expand Up @@ -211,6 +215,32 @@ void MultiCompartmentModelCreator::CreateTensorCompartment(BaseCompartmentPointe
compartmentPointer = tensComp;
}

void MultiCompartmentModelCreator::CreateNODDICompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints)
{
typedef anima::NODDICompartment NODDIType;

NODDIType::Pointer noddiComp = NODDIType::New();
noddiComp->SetEstimateAxialDiffusivity(!m_UseConstrainedDiffusivity);

noddiComp->SetOrientationConcentration(m_OrientationConcentration);
noddiComp->SetExtraAxonalFraction(m_ExtraAxonalFraction);
noddiComp->SetAxialDiffusivity(m_AxialDiffusivity);

if (applyConstraints)
{
if (m_UseCommonDiffusivities)
noddiComp->SetEstimateAxialDiffusivity(false);

if (this->GetUseCommonConcentrations())
noddiComp->SetEstimateOrientationConcentration(false);

if (this->GetUseCommonExtraAxonalFractions())
noddiComp->SetEstimateExtraAxonalFraction(false);
}

compartmentPointer = noddiComp;
}

void MultiCompartmentModelCreator::CreateDDICompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints)
{
std::string error("DDI model not implemented in the public version of ANIMA");
Expand Down
3 changes: 2 additions & 1 deletion Anima/diffusion/mcm/animaMultiCompartmentModelCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class ANIMAMCM_EXPORT MultiCompartmentModelCreator
void CreateStickCompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints);
void CreateZeppelinCompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints);
void CreateTensorCompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints);
void CreateNODDICompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints);
virtual void CreateDDICompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints);

CompartmentType m_CompartmentType;
Expand All @@ -93,7 +94,7 @@ class ANIMAMCM_EXPORT MultiCompartmentModelCreator
bool m_UseCommonDiffusivities;
bool m_UseCommonConcentrations;
bool m_UseCommonExtraAxonalFractions;

bool m_UserDefinedConcentrationBounds;
double m_ConcentrationLowerBound;
double m_ConcentrationUpperBound;
Expand Down
Loading

0 comments on commit 8bb0677

Please sign in to comment.