[Insight-users] Some questions in understanding the N4ITK

Nicholas Tustison ntustison at gmail.com
Tue Jan 10 07:32:03 EST 2012


'x' is just a symbol for the different levels
(not multiplication).

50x100x20 = 50 iterations at the first level, 
100 iterations at the second level, and 20
iterations at the third level.  

At this point I don't know that I can provide
any more help.  I don't have access to Visual
C++ 2008 express and all the windows 
builds of the itkN4... class work just fine.  
Your command line call, other than the 'x',
problem looks fine.  It should work.

Nick



On Jan 10, 2012, at 5:09 AM, Wenwu wrote:

> Hi Nick,
> 
> sorry for my misunderstanding of the symbol meaning.
> 
> 
> 
> On Tue, Jan 10, 2012 at 12:58 PM, Nicholas Tustison <ntustison at gmail.com> wrote:
> Why are you using this 
> 
> -c [50*50*50, 0.001]
> 
> for the convergence?  It should be
> 
> -c [50x50x50, 0.001]
> I want to know what is the mean of the `x`? 
> 
> I correct it as char `x` and Multiply symbol, the result is the same!
> 
> 
>  
> 
> 
> 
> On Jan 10, 2012, at 3:11 AM, Wenwu wrote:
> 
>> Hi Nick,
>> 
>> Today, I run the N4 in Visual c++2008 express, and the result is incredible!  The source data I used is t8slice.nii.gz contained by N4!  The arguments are:
>> 
>> -d 2 -i e:\t81slice.nii.gz -o e:\t81sliceCorrect.mhd -x e:\t81mask.nii.gz -s 2 -c [50*50*50, 0.001] -b [100, 3] -t [0.15, 0.001, 200]
>> 
>> The corrected image is amazing:
>> 
>> <t81sliceCorrect.png> 
>> 
>> 
>> It should be a fully wrong result! Could you help me point out where I made the mistake? 
>> 
>> 
>> Thank you very much!!
>> 
>> 
>> Wenwu
>> 
>> 
>> 
>> On Mon, Jan 9, 2012 at 10:51 PM, Wenwu <cool.wenwu at gmail.com> wrote:
>> Hi Nick,
>> 
>> On Mon, Jan 9, 2012 at 7:12 PM, Nicholas Tustison <ntustison at gmail.com> wrote:
>> Hi Wenwu,
>> 
>> First, I would donwload and updated version of N4.cxx
>> 
>> http://advants.svn.sourceforge.net/viewvc/advants/Examples/N4BiasFieldCorrection.cxx?view=log
>> 
>> as I don't use N4.cxx anymore and have updated.
>> I am waiting for your good news! I am not sure if I made a mistake in Dicom writing part!
>>  
>> 
>> Second, your command line convergence parameter 
>> is incorrect.  I'm guessing you meant
>> 
>> -c [20x20x20,0.001]
>> 
>> Doing that works for me.
>> 
>> Sorry, I made a mistake here, however it was right in the program.
>>  
>> 
>> Nick
>> 
>> Ps. I'm cc'ing the insight users list.  I'd recommend keeping this 
>> conversation on the list---I know it's useful for me to search the
>> archives of previous conversations to find solutions to my
>> problems.
>> 
>> Ok, No pb. 
>>  
>> 
>> On Jan 9, 2012, at 10:18 AM, Wenwu wrote:
>> 
>>> Sorry, I forgot to show the commander to run this test. The code is as following:
>>> N4.exe -d 2 -i e:/image_22 -o e:/image_22BC.mhd -s 2 -c [20*20*20m 0.001] -b [200,3] -t [0.15 0.001, 200] 
>>> 
>>> 
>>> On Mon, Jan 9, 2012 at 6:13 PM, Wenwu <cool.wenwu at gmail.com> wrote:
>>> Hi Nicholas,
>>> 
>>> Thank you very much for your kind help! Now there is another problem needed your help!
>>> 
>>> I run N4 with Dicom image(Reading code I added) to test, because the N4 seems can not output Dicom format, so I choose to output .mhd file. However the outcome is very bad. Could you please give  me some suggestion? 
>>> 
>>> In addition, after adding code of  writing Dicom format, there is an debug error. The code can run in my other program.
>>> The code was added as this:
>>> 
>>> if (outputOption->GetNumberOfParameters() ==0 )
>>> {
>>> ...
>>> typedef itk::GDCMImageIO ImageIOType;
>>> ImageIOType::Pointer gdcImageTypeIO = ImageIOType::New();
>>> ...
>>> Writer->SetFileName(gdcImageTypeIO);
>>> }
>>> // of course, other two cases, I also add them
>>> 
>>> Could you please give some prompt about it?
>>> 
>>> The original MRI image is attached.
>>> The result of the N4 processing with .mhd Format is as following:
>>> 
>>> <image22_BC.png>
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>  
>>> 
>>> On Mon, Jan 9, 2012 at 5:17 PM, Nicholas Tustison <ntustison at gmail.com> wrote:
>>> Hi Wenwu,
>>> 
>>>> There are some problems when I learn the N4ITK. Firstly, in the paper-"N4ITK:Nick's N3 ITK Implementation For MRI Bias Field Correction" , I found there are 9 parameters (m_MaskMabel, m_numberOfHistogamBins, m_WeinerFilterNoise, m_BiasFieldFullWitdthAtHalfMaximum... ,)need to set, it can also be found in the N4ITK package.  However, in the lastest ITK4.0, in the project-ITKBiasCorrectionTestDriver, I open the CMakeLists.txt, and some code is as followiing:
>>>>  
>>>> itk_add_test(NAME itkN4BiasFieldCorrectionImageFilterTest1
>>>>       COMMAND ITKBiasCorrectionTestDriver
>>>>       --compare DATA{Baseline/N4ControlPoints_3D.nii.gz}
>>>>                ${ITK_TEST_OUTPUT_DIR}/N4ControlPoints_3D.nii.gz
>>>>     itkN4BiasFieldCorrectionImageFilterTest
>>>>     2
>>>>     DATA{${ITK_DATA_ROOT}/Input/HeadMRVolumeCompressed.mha}            # input
>>>>     ${ITK_TEST_OUTPUT_DIR}//N4ControlPoints_3D.nii.gz                  # control point lattice  . , I also can not understand the mean of this parameter
>>>> 
>>>>     3                                                                       # shrink factor
>>>>     10x10x10                                                           # number of iterations
>>>>     none                                                               # mask
>>>>     150                                                                # spline distance
>>>>     )
>>>> 
>>> 
>>> The control point lattice is the output defining the bias field.  
>>> You need to remember that this is a test, not a user-level
>>> application which is what N4.cxx encapsulates.
>>> 
>>> Nick
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Wenwu Zhu
>>> IRCAD
>>> University of Strasbourg, France
>>> Email address: cool.wenwu at gmail.com
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Wenwu Zhu
>>> IRCAD
>>> University of Strasbourg, France
>>> Email address: cool.wenwu at gmail.com
>>> 
>> 
>> 
>> 
>> 
>> -- 
>> Wenwu Zhu
>> IRCAD
>> University of Strasbourg, France
>> Email address: cool.wenwu at gmail.com
>> 
>> 
>> 
>> 
>> -- 
>> Wenwu Zhu
>> IRCAD
>> University of Strasbourg, France
>> Email address: cool.wenwu at gmail.com
>> 
> 
> 
> 
> 
> -- 
> Wenwu Zhu
> IRCAD
> University of Strasbourg, France
> Email address: cool.wenwu at gmail.com
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120110/c4caea42/attachment.htm>


More information about the Insight-users mailing list