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

Setting environment error #1

Open
KEswar opened this issue Feb 29, 2024 · 10 comments
Open

Setting environment error #1

KEswar opened this issue Feb 29, 2024 · 10 comments

Comments

@KEswar
Copy link

KEswar commented Feb 29, 2024

docker run --rm --mount type=bind,source=/home/sgbc/HBP_SGBC/Analysis/ITK_analysis_new/ITK/B15305_23_24/SVRTK/,target=/home/data fetalsvrtk/svrtk:general_auto_amd sh -c ' bash /home/auto-proc-svrtk/scripts/auto-brain-reconstruction.sh /home/data/AXT2STIR.nii.gz /home/data/SagT2STIR.nii.gz /home/data/CorT2STIR.nii.gz /home/data/svrtk_amd 1 3.0 0.8 1 ; '



Setting environment ...

rm: cannot remove '/home/tmp_proc/*': No such file or directory



SVRTK for fetal MRI (KCL): auto brain SVR reconstruction for SSTSE / HASTE T2w fetal MRI
Source code: https://github.com/SVRTK/auto-proc-svrtk



Usage: bash /home/auto-proc-svrtk/scripts/auto-brain-reconstruction.sh
[FULL path to the folder with raw T2w stacks in .nii or .dcm, e.g., /home/data/test]
[FULL path to the folder for recon results, e.g., /home/data/out-test]
(optional) [motion correction mode (0 or 1): 0 - minor, 1 - >180 degree rotations] - default: 1
(optional) [slice thickness] - default: 3.0
(optional) [output recon resolution] - default: 0.8
(optional) [number of packages] - default: 1

I am having the above error and I would appreciate it if someone could help me solve this issue. Thank you in advance.

@alenauus
Copy link
Member

hello, you need to provide the folder with t2w .nii.gz / .dcm files rather than the file.
and you need to mount the folder containing the folder with t2 files..

e.g.,

docker run --rm --mount type=bind,source=/home/sgbc/HBP_SGBC/Analysis/ITK_analysis_new/ITK/B15305_23_24,target=/home/data fetalsvrtk/svrtk:general_auto_amd sh -c ' bash /home/auto-proc-svrtk/scripts/auto-brain-reconstruction.sh
/home/data/SVRTK /home/data/svrtk_amd 1 3.0 0.8 1 ; '

@KEswar
Copy link
Author

KEswar commented Mar 1, 2024

It worked without errors; thank you so much. However, the output is not as expected. I have 2D T2 FSE and STIR images acquired in orthogonal planes. I ran your pipeline on these two different image sequences. Attached is the screenshot for your reference. Could you please check it and let me know where it might be wrong?. Also, I want to try segmentation using the Bounti pipeline (for which I need to have a SVR file). I would appreciate your help in this regard. Thnak you.
Screenshot from 2024-03-01 13-05-09

@alenauus
Copy link
Member

alenauus commented Mar 1, 2024

could you please send a screenshot of the original stacks (all views)?
the networks were trained on HASTE - not sure whether it will work with STIR ...
it also normally expects more than 5 stacks ...
was the brain fully covered in all stacks?

These are the input data requirements for SVRTK:

more than 5-6 stacks
full ROI coverage in all stacks
21-40 weeks GA
no extreme shading artifacts
singleton pregnancy
0.55 / 1.5 / 3T
80 – 180ms TE
sufficient SNR and image quality
Output:

@KEswar
Copy link
Author

KEswar commented Mar 7, 2024

These are the postmortem inskull MRI data. we have three stacks( certainly we expect no change in the image quality by running more iterations), each in axial, sagittal, and coronal planes and the brain is fully covered in all three planes. I've attached the screenshot images for your reference.

Screenshot from 2024-03-01 13-05-09
Screenshot from 2024-03-01 17-49-50
Screenshot from 2024-03-01 17-50-17
Screenshot from 2024-03-01 17-50-56
Screenshot from 2024-03-01 17-51-02
Screenshot from 2024-03-01 17-51-35
Screenshot from 2024-03-01 17-52-46

@alenauus
Copy link
Member

alenauus commented Mar 7, 2024

hello, it looks like it did not work because it is post mortem MRI - the networks were trained on the whole uterus HASTE fetal MRI stacks .. i will not work on post mortem stacks.

I would recommend using SVRTK docker then with manually created mask for a selected template stack:

mirtk reconstruct ../svr.nii.gz [number_of_stacks] ../stack1.nii.gz ../stack3.nii.gz -default_thickness [thickness] -resolution 0.8 -svr_only -template ../template-stack.nii.gz -mask ../template-mask.nii.gz

hope this helpw

@KEswar
Copy link
Author

KEswar commented Mar 8, 2024

Thank you for helping me. I have tried SVRTK, both on 2D FSE and 2D STIR images. The command line was executed without errors. However, the output is not visually better. I would appreciate it if you could share your insights on it. The first screenshot is the output on 2D FSE images while the second is on STIR images.
Screenshot from 2024-03-08 11-44-56
Screenshot from 2024-03-08 11-45-18

@alenauus
Copy link
Member

hello,
it looks like reconstruction did work. what resolution did you select? this is the quality you would expect with thick slices ..
i would also use "-no_robust_statistics" flag to avoid removal of slices

could you please open all image in one view ("open as additional image" in ITK-SNAP) and check whether they are aligned in the common space?

@KEswar
Copy link
Author

KEswar commented Mar 11, 2024

Hello,
I have used a 3mm slice thickness with a resolution of 0.8. Please look at the output file and let me know if it is fine. I have used the brain mask file that covered the CSF fully during reconstruction. However, the output shows that a bit of the frontal region is missing in the axial plane and has a step-like appearance in the sagittal plane. I tried Bounti segmentation on the 3D reconstructed image from 2D FSE (the output video is attached for your reference). I would appreciate it if you
Screenshot from 2024-03-11 15-11-13
could provide your insights on it.
Screenshot from 2024-03-11 14-40-20

@alenauus
Copy link
Member

It looks like the mask is small and this cause the cropped tissue ... and this cropping

Could you please try using "-remove_black_backgound" instead of "-mask" ?

Or "-with_background" point and your mask.

I would also run it with "-no_robust_statistics" option.

@KEswar
Copy link
Author

KEswar commented Mar 13, 2024

Hello, Thank you so much for your help. I tried with a bigger mask and with "-no_robust_statistics." The output is good( left-side screenshot). I also tried with "-remove_black_background" instead of "-mask" (right side screenshot). And then, I tried the Bounti algorithm on the two outputs. The segmentation seems to be working well (second screenshot), except on eCSF (could be due to drainage following the postmortem?), GM, and WM. The other deep structures( brainstem, cerebellar regions, and thalamus) are well-identified. From all these exercises, I have a few questions, and I will be glad if you can help me by clearing them.

  1. I have tried reconstruction on STIR images too (I shared the screenshot in the previous conversations). However, the output is not the same as on 2D FSE images, despite the similar TE values and better quality of the data.
  2. Are there algorithms to measure the quality of 2D FSE images before reconstructing the 3D volume? Does the quality of 2D FSE images affect the volume reconstruction?
  3. I have a 3D T2 FSE image acquired on a 3T MRI system (GE). Attached is the screenshot for your reference. Can super-resolution of these images only be performed using the SVRTK algorithm?
  4. We have 3D T1 MPRAGE images; I tried Bounti segmentation. The output is not good as the trained data is in T2 space. Is it a good idea to register 3D T2 FSE and 3D T1 MPRAGE images, perform the Bounti segmentation on 3D T2 FSR images, and then transfer these labels to T1 MPRAGE? Would that be a good approach? I am sorry if this question appears meaningless. However, I just want to hear from you.
    reconstruction
    Segmentation
    3DSagT2FSE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants