flevet / PoCA

https://poca-smlm.github.io/
18 stars 2 forks source link

Headless and batch modes #5

Closed kjamartens closed 3 months ago

kjamartens commented 8 months ago

Hi Florian, Wonderful work on PoCA!

I want to know if it could be possible to run PoCA 'headless' and/or in 'batch' fashion. My main goal, for instance, would be similar to the following:

Importantly, these might be somewhat giant files, and I don't want to interact with them, but just use PoCA as a batch analysis method. I assume that not requiring visualisation might help a lot with performance?

Please let me know if there is anything you can do in this aspect

Best, Koen Martens

flevet commented 8 months ago

Hi Koen,

Batch processing a folder in PoCA is possible even if it is the most intuitive feature... ^^' Nevertheless, until version 0.9.0 (just pushed now), it was not possible to save one object stat file per dataset. This is changed now.

The following macro allows to open a file (in a specific way with the columns), create a delaunay, do a segmentation, save the objec stats and close the dataset:

{
    "MainWindow": {
        "open": {
            "calibration_t": 1.0,
            "calibration_xy": 1.0,
            "calibration_z": 1.0,
            "frame": 4,
            "intensity": 3,
            "separator": 44,
            "sigmaZ": 6,
            "x": 0,
            "y": 1,
            "z": 2
        }
    }
}
{
    "DetectionSet": {
        "computeDelaunay": {
            "onSphere": false
        }
    }
}
{
    "DelaunayTriangulation": {
        "objectCreationParameters": {
            "cutDistance": 50.0,
            "inROIs": false,
            "maxArea": 1000.0,
            "maxLocs": 500,
            "minArea": 0.0,
            "minLocs": 3,
            "useDistance": true,
            "useMaxArea": false,
            "useMaxLocs": false,
            "useMinArea": false,
            "useMinLocs": true
        }
    }
}
{
    "DelaunayTriangulation": {
        "createFilteredObjects": ""
    }
}
{
    "DelaunayTriangulation": {
        "selected": false
    }
}
{
    "ObjectList": {
        "saveStatsObjs": {
            "separator": ","
        }
    }
}
{
    "MainWindow": {
        "close": ""
    }
}

When this macro is loaded in the Runner of theMacro tab, you can click the Open dir button and choose a folder to batch process.

macro_folder

The macro will be applied on all the files inside the folder. If one file is called example1.csv, the object stat file created will be called example1_statsObjs.csv.

v0.9.0 is here: https://github.com/flevet/PoCA/releases/tag/0.9.0

Let me know if everything works.

flevet commented 3 months ago

Closing the issue as there was no follow-up