Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the integration method #39

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
f010ecd
Changed integration method to create good performance on DRO
AnnaBeers Jan 13, 2017
d284f5b
Removed debugging comments
AnnaBeers Jan 13, 2017
79816a1
Indentation Edits
AnnaBeers Jan 17, 2017
e4b8ab4
Second Indentation Edits..
AnnaBeers Jan 18, 2017
3ee8cdc
(temporary?) Solution for NaN Streak from warm fitting
AnnaBeers Jan 19, 2017
cfd0488
Slight fixes to possibly avoid NaN values
AnnaBeers Feb 2, 2017
6466688
New Integration Method - Simplex
AnnaBeers Feb 20, 2017
fbf24df
Added a radio button under "Advanced Options" to select a preferred
AnnaBeers Mar 10, 2017
bbd1d61
Changing the fitting method means switching between two classes. To
AnnaBeers Mar 22, 2017
08fae37
Made much more sensible changes to allow switching fitting algorithm,
AnnaBeers Mar 23, 2017
4cc4203
Potentially found a solution to the multiple fitting algorithm problem,
AnnaBeers Mar 27, 2017
59753e1
These options finally work. Now it's just time to clean up the code.
AnnaBeers Mar 28, 2017
c714194
Some updates to consolidate code. More updates to come.
AnnaBeers Apr 5, 2017
4d8e0c6
Cleaned the code up. It's more or less ready for production. The clock
AnnaBeers Apr 12, 2017
5edf8c0
Changed the name of the Algorithm button to be shorter, take up less
AnnaBeers Apr 14, 2017
8ea4721
Merge pull request #1 from QTIM-Lab/ChooseFittingMethod
AnnaBeers Apr 14, 2017
e585ab0
Reverted accidental parameter changes to Prostate tests.
AnnaBeers Apr 20, 2017
1cc1199
Merge pull request #2 from QTIM-Lab/ChooseFittingMethod
AnnaBeers Apr 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions CLI/PkModeling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ int DoIt( int argc, char * argv[], const T1 &, const T2 &)
converter->SetTR(TRValue);
converter->SetFA(FAValue);
converter->SetBATCalculationMode(BATCalculationMode);
converter->SetToftsIntegrationMethod(ToftsIntegrationMethod);
converter->SetFittingMethod(FittingMethod);
converter->SetconstantBAT(ConstantBAT);
converter->SetRGD_relaxivity(RelaxivityValue);
converter->SetS0GradThresh(S0GradValue);
Expand Down Expand Up @@ -425,18 +427,21 @@ int DoIt( int argc, char * argv[], const T1 &, const T2 &)
quantifier->Sethematocrit(Hematocrit);
quantifier->SetconstantBAT(ConstantBAT);
quantifier->SetBATCalculationMode(BATCalculationMode);
quantifier->SetFittingMethod(FittingMethod);
quantifier->SetToftsIntegrationMethod(ToftsIntegrationMethod);

if(ROIMaskFileName != "")
{
quantifier->SetROIMask(roiMaskVolume);
}

if(ComputeFpv)
{
quantifier->SetModelType(itk::LMCostFunction::TOFTS_3_PARAMETER);
quantifier->SetModelType(itk::PkModelingCostFunction::TOFTS_3_PARAMETER);
}
else
{
quantifier->SetModelType(itk::LMCostFunction::TOFTS_2_PARAMETER);
quantifier->SetModelType(itk::PkModelingCostFunction::TOFTS_2_PARAMETER);
}
quantifier->SetMaskByRSquared(OutputRSquaredFileName.empty());

Expand Down
30 changes: 24 additions & 6 deletions CLI/PkModeling.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<version>0.1.0.$Revision: 19276 $(alpha)</version>
<documentation-url>http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/PkModeling</documentation-url>
<license/>
<contributor>Yingxuan Zhu (while at GE), Andrey Fedorov (SPL), John Evans (MGH), Jim Miller (GE)</contributor>
<contributor>Yingxuan Zhu (while at GE), Andrey Fedorov (SPL), John Evans (MGH), Jim Miller (GE), Andrew Beers (MGH)</contributor>
<acknowledgements><![CDATA[This work is part of the National Alliance for Medical Image Computing (NA-MIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, and by National Cancer Institute as part of the Quantitative Imaging Network initiative (U01CA151261) and QIICR (U24CA180918).]]></acknowledgements>
<parameters>
<label>PkModeling Parameters</label>
Expand All @@ -18,23 +18,23 @@
<longflag>T1Blood</longflag>
<label>T1 Blood Value</label>
<channel>input</channel>
<default>1600</default>
<default>1440</default>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you change this?

</float>
<float>
<name>T1PreTissueValue</name>
<description><![CDATA[T1 value for tissue.]]></description>
<longflag>T1Tissue</longflag>
<label>T1 Tissue Value</label>
<channel>input</channel>
<default>1597</default>
<default>1000</default>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this?

</float>
<float>
<name>RelaxivityValue</name>
<description><![CDATA[Contrast agent relaxivity value. Default value corresponds to Gd-DPTA (Magnevist) at 3T.]]></description>
<longflag>relaxivity</longflag>
<label>Relaxivity Value</label>
<channel>input</channel>
<default>0.0039</default>
<default>0.0045</default>
</float>
<float hidden="true">
<name>S0GradValue</name>
Expand Down Expand Up @@ -90,7 +90,7 @@
<longflag>hematocrit</longflag>
<label>Hematocrit Value</label>
<channel>input</channel>
<default>0.4</default>
<default>0.45</default>
</float>
<float>
<name>AUCTimeInterval</name>
Expand Down Expand Up @@ -204,13 +204,31 @@
<element>PeakGradient</element>
<element>UseConstantBAT</element>
</string-enumeration>
<string-enumeration>
<name>ToftsIntegrationMethod</name>
<longflag>ToftsIntegrationMethod</longflag>
<label>Fitting Integration Method</label>
<description>Determine which integration method will be used when calculating Mean Squared Error in the fitting process.</description>
<default>Recursive</default>
<element>Recursive</element>
<element>Convolutional</element>
</string-enumeration>
<string-enumeration>
<name>FittingMethod</name>
<longflag>FittingMethod</longflag>
<label>Fitting Algorithm</label>
<description>Determine which fitting algorithm will be used for predicting parametric values.</description>
<default>Simplex</default>
<element>Simplex</element>
<element>Levenberg-Marquardt</element>
</string-enumeration>
<integer>
<name>ConstantBAT</name>
<description><![CDATA[Constant Bolus Arrival Time index(frame number).]]></description>
<longflag>constantBAT</longflag>
<label>Constant BAT</label>
<channel>input</channel>
<default>1</default>
<default>10</default>
</integer>
<image>
<name>OutputRSquaredFileName</name>
Expand Down
4 changes: 2 additions & 2 deletions CLI/Testing/Cxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if(QINPROSTATE001)
--compare ${QINPROSTATE001}/Baseline/phantom-ktrans.nrrd
${TEMP}/${testname}-ktrans.nrrd
ModuleEntryPoint
--T1Tissue 1597
--T1Tissue 1000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good - so we already have some tests!

Why did you change the parameter here as well? This is a prostate test dataset, so it definitely should correspond to prostate tissue T1!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fedorov Good morning! This was actually an accident. Before I understood the XML file, I was trying to change the GUI default parameters to make testing easier, and mistakenly changed those bits of code. I can submit a quick commit soon reverting those changes back. Thanks for catching that! And it looks like I now know where to look to make my own tests..

--T1Blood 1600
--relaxivity 0.0039
--S0grad 15.0
Expand Down Expand Up @@ -136,7 +136,7 @@ endif()
# set(testname ${CLP}TestDCEMRIData)
# add_test(NAME ${testname} COMMAND ${Launcher_Command} $<TARGET_FILE:${CLP}Test>
# ModuleEntryPoint
# --T1Tissue 1597
# --T1Tissue 1000
# --T1Blood 1600
# #--TR 3.984
# #--FA 15
Expand Down
8 changes: 7 additions & 1 deletion CLI/itkConcentrationToQuantitativeImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace itk
*
* An second input, specifying the location of the arterial input
* function, allows for the calculation to be adjusted for blood
* verses tissue.
* versus tissue.
*
* \note
* This work is part of the National Alliance for Medical Image Computing
Expand Down Expand Up @@ -135,6 +135,10 @@ class ITK_EXPORT ConcentrationToQuantitativeImageFilter : public ImageToImageFil
itkSetMacro( constantBAT, int);
itkGetMacro( BATCalculationMode, std::string);
itkSetMacro( BATCalculationMode, std::string);
itkGetMacro( ToftsIntegrationMethod, std::string);
itkSetMacro( ToftsIntegrationMethod, std::string);
itkGetMacro( FittingMethod, std::string);
itkSetMacro( FittingMethod, std::string);

void SetTiming(const std::vector<float>& inputTiming);
const std::vector<float>& GetTiming();
Expand Down Expand Up @@ -243,6 +247,8 @@ class ITK_EXPORT ConcentrationToQuantitativeImageFilter : public ImageToImageFil
bool m_MaskByRSquared;
int m_constantBAT;
std::string m_BATCalculationMode;
std::string m_ToftsIntegrationMethod;
std::string m_FittingMethod;

std::vector<float> m_Timing;

Expand Down
Loading