Skip to content

Reproduce NanoJ eSRRF results with NanoPyx #132

@arthursw

Description

@arthursw

Hello,

I try to reproduce a Fiji eSRRF computation with NanoPyx but I get different results.

Here is the image that I use:

Image

You can download and unzip it:
C1-Bio-01.tifMod.tif.zip

Here is the NanoJ code I use in Fiji:
run("eSRRF - Analysis", "magnification=5 radius=3 sensitivity=3 #=200 vibration avg");

(I also tried run("eSRRF - Analysis", "magnification=5 radius=3 sensitivity=3 #=200 vibration avg wide-field #_0=25 "); but it does not change much).

And here is the resulting image:

Image

And with this python code:

from nanopyx.methods import eSRRF
from nanopyx.core.transform.sr_temporal_correlations import calculate_eSRRF_temporal_correlations
import tifffile
from skimage import io

with tifffile.TiffFile('path/to/C1-Bio-01.tifMod.tif') as tif:
    dataset_original = tif.asarray()

frames_per_timepoint = 200

for i in range(dataset_original.shape[0] // frames_per_timepoint):

    block = dataset_original[i * frames_per_timepoint : (i + 1) * frames_per_timepoint]
    result = eSRRF(block, magnification=5, radius=3, sensitivity=3) # _force_run_type='_run_unthreaded'
    io.imsave(f"path/to/results/esrrf{i}.tif", result)
    esrrf_temporal_correlation = calculate_eSRRF_temporal_correlations(result, "AVG")
    io.imsave(f"path/to/results/esrrf{i}_temporal_correlation.tif", esrrf_temporal_correlation)

This is the result I get:

Image

I tried on a mac M1 and linux with a GPU.

I also tried _force_run_type='_run_unthreaded' to avoid GPU problems (the pixel grid pattern makes me think of an misalignment issue) but I get the same result.

Do you have any idea why I get different results? Did I miss anything?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions