You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
surfa.Volume.resize() and freesurfer MRIupsampledN()/MRIdownsampleN() works differently.
271
+
272
+
surfa.Volume.resize() logic:
273
+
1. keep the original image 'rotation' and 'center' parameters when computing the resampled image geom
274
+
2. resampled image crs0 remains the same as originial image. This may cause all voxels to be interpolated
275
+
3. force the originial and resampled image in the same RAS space when computing target-source vox2vox matrix
276
+
4. by default, 'linear' interpolation method is used
277
+
278
+
MRIupsampledN()/MRIdownsampleN() logic:
279
+
1. the RAS of a voxel is at the center of the voxel, so the image corner is located at CRS = [-.5 -.5 -.5]
280
+
2. the center of the resampled image crs0 = -0.5 + 1.0 / (2 * factor) in originial image voxel space (generally used in FS code)
281
+
3. the original and resampled images share the same RAS space (implicit)
282
+
4. the resampled image p0ras can be computed as p0ras = aff_orig @ crs0
283
+
5. re-compute the resampled image 'center' parameters after correcting p0ras of aff_resampled
284
+
6. The way the offset/center is set up, some voxels will fall in the same spot as the original volume which means they will not have any interpolation effects.
285
+
286
+
The target vox2ras from surfa.Volume.resize() and freesurfer MRIupsampledN()/MRIdownsampleN() are different,
287
+
but they share the same RAS space. Because the resulting target-source vox2vox is different, surfa.Volume.resize()
288
+
interpolates the voxel values from locations that are different from MRIupsampledN()/MRIdownsampleN().
0 commit comments