[Rtk-users] problem while determining the interpolation weights in 4D ROOSTER Reconstruction

Cyril Mory cyril.mory at creatis.insa-lyon.fr
Thu Jan 11 04:01:54 EST 2018


Sorry, I made a mistake in the attached files. Ignore 
peaksOverShroud.png, I intended to send peaksOverOriginalShroud.png 
instead (the shroud.mhd you sent, overlaid with the sphase.txt you sent) 
so you can see how I cropped the shroud to improve the results of 
rtkextractshroudsignal.


Regards

Cyril


On 11/01/2018 09:57, Cyril Mory wrote:
>
> Hi Ruoyan,
>
>
> The original sphase.txt you sent a few days earlier does not look like 
> the Matlab plot you just sent. I guess you modified it in the 
> meantime. It does not matter much, but for one of the images I'm 
> sending, I've used your old sphase.txt.
>
>
> I am not the best person to help you with your SimpleRTK problem. If 
> you're used to Matlab, let's go for that way.
>
> First, you can open your shroud image using Matlab, for example with 
> the function read_mhd() provided in MITK. See 
> http://mitk.org/wiki/The_Medical_Imaging_Interaction_Toolkit_(MITK) . 
> Second, to crop it using Matlab, simply keep the part where the 
> diaphragm motion is most visible (I removed the whole top part, wide 
> 285 pixels), then save the file back to croppedShroud.mhd, then rerun 
> phase extraction.
>
>
> I have used another tool than Matlab to crop the image, but it 
> shouldn't matter. And I have rerun phase extraction, and generated the 
> overlay of peaks over shroud image in both cases. See the attached 
> pictures. Note that a few respiratory cycles have been missed by the 
> algorithm. You can try playing with parameters of 
> rtkextractshroudsignal, but those cycles will be hard to detect 
> anyway, since they correspond to irregular breathing (it looks like 
> the patient coughed). You can live with that, or modify the phase file 
> manually to add those cycles: the phase is nothing more than a number 
> that goes linearly from 0 to 1 between one peak and the next.
>
> I hope it helps,
> Cyril
>
> On 11/01/2018 07:54, ry.meng wrote:
>> Hi Cyril,
>>
>> The new code works fine, I still got some questions about sphase.txt 
>> file.
>> When building simpleRTK, I met an error "error MSB6006: 
>> “cmd.exe”exit,code 1", and I didn't find a solution. So I just plot 
>> sphase.txt with Matlab and compare it with respiration signals 
>> provided by raw data. They are quite different. I am not very clear 
>> about how to crop the shroud, can you share the method? Thanks a lot.
>>
>>>>>> Regards
>>>>>>
>>>>>> Ruoyan Meng
>>>>>>
>>
>> On 1/10/2018 00:33,Cyril Mory<cyril.mory at creatis.insa-lyon.fr> 
>> <mailto:cyril.mory at creatis.insa-lyon.fr> wrote:
>>
>>>     Ruoyan,
>>>
>>>
>>>     From the shroud image, the signal extraction sometimes fails to
>>>     find the period of the motion of the diaphragm, which results in
>>>     incorrect phase detection. The easiest way to make sure your
>>>     respiratory phase has been correctly detected is to used the
>>>     following python script:
>>>
>>>     https://www.creatis.insa-lyon.fr/~mory/showPeaksOverShroud.py
>>>
>>>
>>>     You have to save your shroud image with .mhd extension, because
>>>     simpleRTK can't read .mha (I think), so modify the command line
>>>     that generates it (in the 4DROOSTER wiki page, that would be
>>>
>>>     rtkamsterdamshroud--path  . \
>>>                         --regexp  '.*.his'  \
>>>                         --output  shroud.mha \
>>>                         --unsharp  650)
>>>     Change "shroud.mha" into "shroud.mhd", re-run all command lines
>>>     except the ROOSTER reconstruction, and then run
>>>
>>>     "showPeaksOverShroud.py shroud.mhd sphase.txt"
>>>
>>>     It will generate an RGB image named "peaksOverShroud.png", which
>>>     shows the shroud, and overlays the detected extrema of the
>>>     phase. If your detection is wrong, you'll see it. The script
>>>     requires SimpleRTK, python and a few python libs.
>>>
>>>     If your peaks detection is indeed incorrect, you can try
>>>     cropping the shroud to the region where the periodic signal is
>>>     most visible. This is usually sufficient. If you need more help,
>>>     send over your shroud.mhd and shroud.raw file.
>>>
>>>     Regards,
>>>     Cyril
>>>
>>>     On 09/01/2018 15:47, ry.meng wrote:
>>>>     Hi Cyril,
>>>>
>>>>     The attachment is our projections.mhdfile and we are running
>>>>     the latest RTK, example data works well.
>>>>     I have another question about our sphase.txt file. As my
>>>>     understanding of 4D reconstruction process, spase.txt file
>>>>     should be the optimal fit respiration signals. But in our file,
>>>>     it only has 6 cycles, which is impossible, it confused me.
>>>>     I'm now testing your new code with our data, hope it works!
>>>>     Thanks for your help.
>>>>>>
>>>>>>
>>>>>>     Regards
>>>>>>
>>>>>>     Ruoyan Meng
>>>>>>
>>>>     On 1/9/2018 20:48,Cyril Mory<cyril.mory at creatis.insa-lyon.fr>
>>>>     <mailto:cyril.mory at creatis.insa-lyon.fr> wrote:
>>>>
>>>>         Hi again Ruoyan,
>>>>
>>>>
>>>>         I have investigated further and found the source of the
>>>>         problem: the code performs a rounding of the phase signal
>>>>         to two digits, which for some values of your phase ended up
>>>>         to be 1. And the rest of the code assumes that the phase
>>>>         belongs to [0; 1[, i.e. there should never be a value 1.
>>>>         The rounding is useful for optimization: projections with
>>>>         identical phases can be forward and backprojected together,
>>>>         which is faster than one-by-one, and with high-precision
>>>>         phase values, there are never two equal phase values.
>>>>
>>>>
>>>>         So I just fixed the bug by setting the phase to 0 when its
>>>>         rounding is equal to 1, which should do the trick. The pull
>>>>         request is being tested, it should be merged soon.
>>>>
>>>>
>>>>         Thanks for reporting your issue.
>>>>
>>>>         Regards,
>>>>
>>>>         Cyril
>>>>
>>>>
>>>>         On 09/01/2018 11:31, Cyril Mory wrote:
>>>>>
>>>>>         Hi Ruoyan,
>>>>>
>>>>>
>>>>>         I've had a look at your file sphase.txt, it looks
>>>>>         perfectly fine to me. The problem must lie elsewhere. Does
>>>>>         the application 4D ROOSTER work with the example data
>>>>>         provided on the wiki ? If it does, then the problem lies
>>>>>         in your data. In that case, please run
>>>>>
>>>>>
>>>>>         rtkprojections --path D:\bd\20171116 --regexp .*.his
>>>>>         -oD:\bd\20171116\projections.mhd
>>>>>
>>>>>
>>>>>         and send us the "projections.mhd" file. It will contain
>>>>>         only the metadata of your projections, and we'll be able
>>>>>         to run the same command line as you and try to reproduce
>>>>>         the problem.
>>>>>
>>>>>
>>>>>         If, on the other hand, it doesn't even work with the
>>>>>         example data provided on the wiki, it is a software
>>>>>         problem. In that case, can you first update to the latest
>>>>>         RTK (the git master branch), recompile and test again ?
>>>>>
>>>>>
>>>>>         Best regards,
>>>>>
>>>>>         Cyril
>>>>>
>>>>>
>>>>>         On 26/12/2017 10:47, ry.meng wrote:
>>>>>>         Hi
>>>>>>
>>>>>>         Thank you for your reply. I have checked the value in
>>>>>>         sphase.txt and don't have any value larger or equal to 5.
>>>>>>         Maybe the problem lies elsewhere? Thanks.
>>>>>>
>>>>>>         Regards
>>>>>>
>>>>>>         Ruoyan Meng
>>>>>>
>>>>>>         On 12/26/2017 17:14,Simon
>>>>>>         Rit<simon.rit at creatis.insa-lyon.fr>
>>>>>>         <mailto:simon.rit at creatis.insa-lyon.fr> wrote:
>>>>>>
>>>>>>             Hi,
>>>>>>             If you look at the code
>>>>>>             <https://github.com/SimonRit/RTK/blob/master/code/rtkPhasesToInterpolationWeights.hxx#L154>,
>>>>>>             you'll see that the error message corresponds to the
>>>>>>             case where you have a phase which equals the number
>>>>>>             of frames. This cannot be since it is 0-based. In
>>>>>>             other words, with the option "--frames 5", you cannot
>>>>>>             have a value larger or equal to 5 in your file
>>>>>>             sphase.txt.
>>>>>>             Simon
>>>>>>
>>>>>>             On Mon, Dec 25, 2017 at 9:36 AM, ry.meng
>>>>>>             <ry.meng at siat.ac.cn <mailto:ry.meng at siat.ac.cn>> wrote:
>>>>>>
>>>>>>
>>>>>>                 Hi:
>>>>>>                 When I tried  the application of 4D ROOSTER
>>>>>>                 Reconstruction with my own data, it will stop for
>>>>>>                 the following reason: problem while determining
>>>>>>                 the interpolation weights. Maybe you guys have
>>>>>>                 met this problem before and have a solution for
>>>>>>                 it. Thank you very much and I hope to receive
>>>>>>                 your reply soon.
>>>>>>
>>>>>>
>>>>>>                 Happy Holidays!
>>>>>>
>>>>>>
>>>>>>                 Regards
>>>>>>
>>>>>>                 Ruoyan Meng
>>>>>>
>>>>>>                 ------------------------------------------------------------------------------------------
>>>>>>
>>>>>>                 Research Center for Medical Robotics and
>>>>>>                 Minimally Invasive Surgical Devices,
>>>>>>                 Institute of Biomedical and Health Engineering,
>>>>>>                 Shenzhen Institutes of Advanced Technology,
>>>>>>                 Chinese Academy of Sciences
>>>>>>                 Tel: +86-18576617767 <tel:+86%20185%207661%207767>
>>>>>>                 Email: ry.meng at siat.ac.cn <mailto:qs.zhu at siat.ac.cn>
>>>>>>                 Zip:       518055
>>>>>>                 Add: No. 1068 Xueyuan Avenue, Nanshan, Shenzhen,
>>>>>>                 China
>>>>>>                 <https://maps.google.com/?q=No.+1068+Xueyuan+Avenue,+Nanshan,+Shenzhen,+China&entry=gmail&source=g>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>                 _______________________________________________
>>>>>>                 Rtk-users mailing list
>>>>>>                 Rtk-users at public.kitware.com
>>>>>>                 <mailto:Rtk-users at public.kitware.com>
>>>>>>                 https://public.kitware.com/mailman/listinfo/rtk-users
>>>>>>                 <https://public.kitware.com/mailman/listinfo/rtk-users>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>         _______________________________________________
>>>>>>         Rtk-users mailing list
>>>>>>         Rtk-users at public.kitware.com
>>>>>>         https://public.kitware.com/mailman/listinfo/rtk-users
>>>>>
>>>>>
>>>>>
>>>>>         _______________________________________________
>>>>>         Rtk-users mailing list
>>>>>         Rtk-users at public.kitware.com
>>>>>         https://public.kitware.com/mailman/listinfo/rtk-users
>>>>
>>>
>>
>
>
>
> _______________________________________________
> Rtk-users mailing list
> Rtk-users at public.kitware.com
> https://public.kitware.com/mailman/listinfo/rtk-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/rtk-users/attachments/20180111/d2e15bee/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: peaksOverOriginalShroud.png
Type: image/png
Size: 329838 bytes
Desc: not available
URL: <https://public.kitware.com/pipermail/rtk-users/attachments/20180111/d2e15bee/attachment-0001.png>


More information about the Rtk-users mailing list