Could you please advice which the best syntax that I could use to smooth my Ex-vivo data before template construction?
I went through your documentation, previous issues and command line, which If ound the following syntax;
sct_smooth_spinalcord.py -i -c <centerline/segmentation>
sct_smooth_spinalcord -i -s <centerline/segmentation>
sct_maths -i data.nii -smooth (previous issue was about segma value estimation) If this is the right one how I could output the sigma value please?
In addition, I tried this syntax sct_smooth_spinalcord -i -s <centerline/segmentation> and result does seem getting any improvement from the top and bottom. (please find screenshot).
Sorry I couldn’t use the upload botton (not working) to have images attached(can you please check it ou if workin befor posting the issue?)
Could you please try one more time to upload your files/screenshots? And, if it doesn’t work, could you let us know which of the upload steps is broken?
However, the screenshots are not labeled, so it is not clear to me which screenshots correspond to the input image, and which screenshots correspond to the output images. (It is also unclear which commands were used to generate the example outputs in your screenshots.)
To help with debugging/testing, are you able to upload the exact image files (nii.gz), as well as sharing the exact commands that you have tried?
Thank you very much for your prompt response and invaluable information. I apologies for any confusion. My question was about what is the the best SCT_tool can I use to smooth my dataset before template generation. I used sct_smooth_spinalcord -i -s <centerline/segmentation> for the following sample and result on the second screenshot.
Do you think should I continue on this method of registration or use your framework? by the way, most my preprocessing steps I used SCT tools to preprocess my dataset except template generation STEP.
I would not smooth the data before template creation, given that: (i) a template creation process involves multiple subjects, hence ‘smoothing’ will naturally occur once aggregating and averaging all subjects together, (ii) smoothing will reduce your effective image resolution, (iii) sct_smooth_spinal cord involves straightening of the cord, which in general is fine, but in your case, you have an extremely high resolution, and I’m afraid the through-slice interpolation will introduce more errors than if you were not smoothing.
do you think during registration can these damage and variables be removed or (reduced)? I did it multiple times but didn’t find an automatic way in ants scripts to solve out.
Please look at the previous message above for last 3 screenshots after smoothing step and here without it.
Sorry @jcohenadad for the misunderstanding I caused. My dataset when scanned they have some artifacts and when they averaged the template result quality affected. What I read that during registration as you said this issues would be handled during the registration process. Thus, I thought the program automatically would find those local areas/voxels that are greater than 2xStandard Deviation, and then removing (masking these out) when taking the template average during the iteration. In my case, Ants program didn’t handle these issues and template quality not quiet PERFECT. I read through your documentation in particular the importance of smoothing the data could improve the quality. Im not sure whether this step will help in my case or ignore the smoothing step.
As you can see below, these dataset were scanned long time ago. Last screenshot had a tissue damaged. These affects appeared like some threads across the image after averaging. I don’t know if there is a way to replace the signal at each voxel with a weighted average of that voxel’s neighbors using your smoothing tools prior averaging if would help.
I don’t think it is a good idea to compromise the entire image with smoothing (which again, will reduce the effective resolution), to fix a very small proportion of your image. Moreover, smoothing will not fix the issue, it will only mitigate it.
One possibility would be to mask out this region during your template creation. If you have enough samples, the transition at the edge of the mask won’t be too visible. And to make it less visible, you could use a soft mask (ie: 3D smooth your mask using a 3D kernel, ie: not with sct_smooth_spinalcord).
Thank you very much for your feedback. I tried what you’ve suggested using FSL and got the result below. I used Itksnap to msk out the affected region and used Kernal 3D implemented in FSL platform.I’m not sure whether I did the wrong or right thing that you’ve recommend.
The smoothing does not look right-- you need to ignore the ‘zeroed’ voxels during your smoothing. Anyway, I don’t think that smoothing is a good idea.
About your installation issue with the NIST pipeline, a few students in my team are currently looking into that-- they will post additional information in the repos to help with the installation