Giter VIP home page Giter VIP logo

Comments (5)

neurolabusc avatar neurolabusc commented on September 28, 2024 1

Understood. All my examples above are from low resolution statistical maps (2mm isotropic) loaded on the high-resolution template mni152_2009bet (0.5mm isotropic). Some interpolation is unavoidable. I also think the linear interpolation is appropriate as higher-order interpolation generates ringing artifacts near sharp edges, which is exactly what you get with a thresholded image. As you say, some artifacts are always going to result from up-sampling data, but I do think the current implementation is as good as any other I have seen.

from mricrogl10_old.

neurolabusc avatar neurolabusc commented on September 28, 2024

Beyond the manuals, I would suggest you look at the cluster threshold script - you may also want to look at the Matlab script nii_threshreslicecluster.m. There are no good solutions for reslicing an image to a high resolution after the user has thresholded the data. During thresholding, one artificially sets all the sub-threshold voxels to have an intensity of zero. In reality, due to smoothing and partial volume effects, subthreshold voxels near surviving voxels typically have values near the threshold, but this information is thrown away. The user has willfully eliminated data that would be useful for spatial interpolation. The correct solution is to interpolate your raw data and then apply your threshold. Any other solution is open to criticisms.

I strongly recommend you open your unthresholded maps into MRIcroGL, and then apply your threshold. This will ensure that maximum data is preserved. If this is not possible, you have several options, each with its own limitations:

  1. Uncheck "Smooth when Loading" from the overlay menu. This will apply nearest neighbor interpolation that results in jagged images.
  2. Open your overlay as a smoothed threshold, and then apply a binary threshold at half the intensity of your threshold. For example, if your image was thresholded with Z=5, you would want to set the overlay to have a min=2.5 and a max = 2.5. This should roughly preserve your outline, but does not show variability in intensity.
  3. Open your overlay on a background scan resliced to the overlay - for example using my nii_reslice_target.m script. This creates a background image with the same (low) resolution as your statistical map - no interpolation is required, but the image will be blurry.

I will explore your third option, but I really think this is an issue of closing the barn door after the horse has bolted. You will be much happier if you work with unthresholded images.

from mricrogl10_old.

neurolabusc avatar neurolabusc commented on September 28, 2024

Why don't you try out this Matlab/SPM script nii_reslice_target_thresh to see if you like this solution. For example, the command nii_reslice_target_thresh('spmT_5.nii', '','mni152_2009_256.nii') will reslice the thresholded map spmT_5 to match the resolution of mni152_2009_256. The image below shows the results of nearest neighbor (left), your suggestion (middle) and the new script (right).

  • Nearest neighbor (left) preserves the volume of the region, but has jagged borders and jagged intensities inside.
  • Dividing by the interpolated binary mask (middle) tends to artificially dilate the region. For example, a voxel which only includes 10% of surviving voxels appears to have survived. Another defect of this approach is that the edge is very jagged, effectively a dilated nearest-neighbor interpolation.
  • My suggestion (right) is interpolating the binary mask and then only allowing regions that have at least 50% coverage to survive, and any voxel which does survive is given the threshold value. This provides a smoothly interpolated interior and a somewhat more smooth edge border. Note that in the rendered view this looks much less jagged than the other views.

threshold

from mricrogl10_old.

neurolabusc avatar neurolabusc commented on September 28, 2024

@mzunhammer I am going to close this request: when I looked into this, the current MRIcroGL solution is close to optimal. Below you can see the results of nearest-neighbor (left), linear rescale then threshold and MRIcroGL's current threshold then linearly rescale (right). The left and middle images indicate the best case scenario, where we have all the data (perhaps with the exception of the brain mask for the middle image, where regions outside the brain are artificially set to zero despite smoothing). The current MRIcroGL solution detects that the image is thresholded (in this case at Z=5) and after rescaling any voxels less than 2.5 are set to zero and any voxels in the range 2.5...5 are set to 5. If you have an example of edge effects that you think could be addressed, I would like to see them. However, I suspect the real issue is upstream from MRIcroGL, and you can get a better solution by providing MRIcroGL with better data.

nn_linthresh_threshlin

from mricrogl10_old.

mzunhammer avatar mzunhammer commented on September 28, 2024

I've just revisited the issue based on your recommendations. I'm sorry, it was a mistake from my side: The issue occured only when loading thresholded images (binary brain mask) with a resolution of 2x2x2 mm on top of a 1x1x1 mm template, but not on a 2x2x2 mm template. The observed "edge effect" apparently was not caused by the smoothing, but by the re-sampling of the lower resolution image (which is unavoidable, I think). Thank you for your detailed reply and for looking into the issue!

from mricrogl10_old.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.