-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from Florent2305/fusion
Fusion of private and public Anima
- Loading branch information
Showing
181 changed files
with
19,153 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Explicitly declare text files you want to always be normalized and converted | ||
# to native line endings on checkout. | ||
*.c text eol=lf | ||
*.h text eol=lf | ||
*.cxx text eol=lf | ||
*.hxx text eol=lf | ||
*.cpp text eol=lf | ||
*.txt text eol=lf | ||
|
||
# Denote all files that are truly binary and should not be modified. | ||
*.png binary | ||
*.jpg binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*~ | ||
*.swp | ||
*.user | ||
*.orig | ||
*.directory | ||
*.DS_Store | ||
*.aps | ||
*.autosave | ||
CMakeLists.txt.user.* | ||
CMakeFiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ANIMA: Source Code Repository | ||
----- | ||
|
||
ANIMA has been created as the new place to hold the softwares from Empenn. Mainly based on ITK and VTK, it has been designed to hold C++ source code in a modular structure. People in the team are encouraged to contribute their algorithms here so that others may benefit from it easily. | ||
|
||
Refer to the [wiki](https://github.com/Inria-Visages/Anima/wiki) for more information |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
add_subdirectory(dti_estimator) | ||
add_subdirectory(dti_scalar_maps) | ||
add_subdirectory(dwi_simulator_from_dti) | ||
add_subdirectory(flip_tensors) | ||
add_subdirectory(background_noise_variance_estimator) | ||
add_subdirectory(dti_non_central_chi_estimator) |
38 changes: 38 additions & 0 deletions
38
Anima/diffusion/dti/background_noise_variance_estimator/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
if(BUILD_TOOLS) | ||
|
||
project(animaBackgroundNoiseVarianceEstimator) | ||
|
||
## ############################################################################# | ||
## List Sources | ||
## ############################################################################# | ||
|
||
list_source_files(${PROJECT_NAME} | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
) | ||
|
||
|
||
## ############################################################################# | ||
## add executable | ||
## ############################################################################# | ||
|
||
add_executable(${PROJECT_NAME} | ||
${${PROJECT_NAME}_CFILES} | ||
) | ||
|
||
|
||
## ############################################################################# | ||
## Link | ||
## ############################################################################# | ||
|
||
target_link_libraries(${PROJECT_NAME} | ||
${ITKIO_LIBRARIES} | ||
AnimaStatisticalTests | ||
) | ||
|
||
## ############################################################################# | ||
## install | ||
## ############################################################################# | ||
|
||
set_exe_install_rules(${PROJECT_NAME}) | ||
|
||
endif() |
119 changes: 119 additions & 0 deletions
119
...i/background_noise_variance_estimator/animaBackgroundNoiseVarianceEstimationImageFilter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
#pragma once | ||
|
||
#include <iostream> | ||
#include <animaNumberedThreadImageToImageFilter.h> | ||
#include <itkVectorImage.h> | ||
#include <itkImage.h> | ||
#include <vnl/vnl_matrix.h> | ||
#include <vector> | ||
|
||
namespace anima | ||
{ | ||
template <typename TInputImage> | ||
class BackgroundNoiseVarianceEstimationImageFilter : | ||
public anima::NumberedThreadImageToImageFilter < TInputImage, itk::Image<unsigned char,3> > | ||
{ | ||
public: | ||
/** Standard class typedefs. */ | ||
typedef BackgroundNoiseVarianceEstimationImageFilter Self; | ||
typedef itk::Image<unsigned char,3> TOutputImage; | ||
typedef itk::VectorImage <double,3> VectorImageType; | ||
typedef VectorImageType::Pointer VectorImagePointer; | ||
|
||
typedef anima::NumberedThreadImageToImageFilter <TInputImage, TOutputImage> Superclass; | ||
typedef itk::SmartPointer<Self> Pointer; | ||
typedef itk::SmartPointer<const Self> ConstPointer; | ||
|
||
/** Method for creation through the object factory. */ | ||
itkNewMacro(Self) | ||
|
||
/** Run-time type information (and related methods) */ | ||
itkTypeMacro(BackgroundNoiseVarianceEstimationImageFilter, anima::NumberedThreadImageToImageFilter) | ||
|
||
typedef typename TOutputImage::PixelType OutputPixelType; | ||
typedef typename TInputImage::PixelType InputPixelType; | ||
|
||
/** Image typedef support */ | ||
typedef TInputImage InputImageType; | ||
typedef TOutputImage OutputImageType; | ||
typedef typename InputImageType::Pointer InputImagePointer; | ||
typedef typename InputImageType::IndexType InputImageIndexType; | ||
typedef typename InputImageType::PixelType InputImagePixelType; | ||
typedef typename OutputImageType::Pointer OutputImagePointer; | ||
|
||
/** Superclass typedefs. */ | ||
typedef typename Superclass::InputImageRegionType InputImageRegionType; | ||
typedef typename Superclass::OutputImageRegionType OutputImageRegionType; | ||
|
||
//! Actually computes partial variances for this region | ||
void ComputePartialVariance(const OutputImageRegionType ®ion); | ||
|
||
//! Actually updates output for this region | ||
void PartialUpdateOutput(const OutputImageRegionType ®ion); | ||
|
||
itkSetMacro(PValueThreshold, double) | ||
itkGetMacro(OutputVariance, double) | ||
|
||
itkSetMacro(NumberOfCoils, unsigned int) | ||
|
||
void SetTheoreticalSnr(std::vector <double> theoreticalSnr ){m_TheoreticalSnr = theoreticalSnr;} | ||
void SetBValuesList(std::vector <double> bValuesList ){m_BValuesList = bValuesList;} | ||
|
||
itkSetMacro(QuantileInitialization, double) | ||
|
||
itkSetMacro(EstimatedB0Image, InputImagePointer) | ||
itkSetMacro(DTIImage, VectorImagePointer) | ||
|
||
void AddGradientDirection(unsigned int i, std::vector <double> &grad); | ||
|
||
protected: | ||
BackgroundNoiseVarianceEstimationImageFilter() | ||
: Superclass() | ||
{ | ||
m_NumberOfCoils = 1; | ||
m_PValueThreshold = 0.05; | ||
m_OutputVariance = 0; | ||
m_SlopeInterceptDesignPart = 0; | ||
m_QuantileInitialization = 0.5; | ||
|
||
m_EstimatedB0Image = NULL; | ||
m_DTIImage = NULL; | ||
} | ||
|
||
virtual ~BackgroundNoiseVarianceEstimationImageFilter() {} | ||
|
||
//Redefine virtual functions | ||
void GenerateData() ITK_OVERRIDE; | ||
|
||
unsigned int ComputeInitialOutputFromDTI(); | ||
unsigned int UpdateOutputFromPValues(); | ||
|
||
private: | ||
ITK_DISALLOW_COPY_AND_ASSIGN(BackgroundNoiseVarianceEstimationImageFilter); | ||
|
||
std::vector <double> m_PartialVariances; | ||
std::vector <unsigned int> m_PartialNumberOfCoils; | ||
|
||
itk::Image<double,3>::Pointer m_WorkPValImage; | ||
InputImagePointer m_EstimatedB0Image; | ||
VectorImagePointer m_DTIImage; | ||
|
||
std::vector <double> m_BValuesList; | ||
std::vector< std::vector <double> > m_GradientDirections; | ||
vnl_matrix <double> m_DesignMatrix; | ||
double m_SlopeInterceptDesignPart; | ||
double m_QuantileInitialization; | ||
|
||
double m_OutputVariance; | ||
unsigned int m_TotalNumberOfCoils; | ||
unsigned int m_NumPixels; | ||
unsigned int m_NumberOfCoils; | ||
std::vector <double> m_TheoreticalSnr; | ||
double m_PValueThreshold; | ||
|
||
static const unsigned int m_NumberOfComponents = 6; | ||
}; | ||
|
||
} // end of namespace anima | ||
|
||
#include "animaBackgroundNoiseVarianceEstimationImageFilter.hxx" |
Oops, something went wrong.