|
| 1 | +import skimage |
| 2 | + |
1 | 3 | from fluidimage.topologies.surface_tracking import Topology |
2 | 4 |
|
| 5 | + |
| 6 | +def rescale_intensity(tuple_path_image): |
| 7 | + """ |
| 8 | + Rescale image intensities, between the specified minima and maxima, |
| 9 | + by using a multiplicative factor. |
| 10 | +
|
| 11 | + ---------- |
| 12 | + minima, maxima : float |
| 13 | + Sets the range to which current intensities have to be rescaled. |
| 14 | +
|
| 15 | + """ |
| 16 | + path, img = tuple_path_image |
| 17 | + # the processing can be adjusted depending on the value of the path. |
| 18 | + print("process file:\n" + path) |
| 19 | + minima = 0 |
| 20 | + maxima = 4095 |
| 21 | + out_range = (minima, maxima) |
| 22 | + img_out = skimage.exposure.rescale_intensity(img, out_range=out_range) |
| 23 | + return img_out |
| 24 | + |
| 25 | + |
3 | 26 | params = Topology.create_default_params() |
4 | 27 |
|
5 | | -params.film.fileName = "film.cine" |
6 | | -params.film.path = "../../../surfacetracking/111713" |
7 | | -params.film.path_ref = "../../../surfacetracking/reference_water" |
| 28 | +path_src = "../../image_samples/SurfTracking/Images" |
| 29 | + |
| 30 | +params.images.path = path_src |
| 31 | +params.images.path_ref = path_src |
| 32 | +params.images.str_subset = ":4:2" |
| 33 | +params.images.str_subset_ref = ":3" |
| 34 | + |
| 35 | +params.surface_tracking.xmin = 200 |
| 36 | +params.surface_tracking.xmax = 250 |
| 37 | +params.surface_tracking.correct_pos = True |
| 38 | + |
| 39 | +params.preproc.im2im = rescale_intensity |
8 | 40 |
|
9 | | -# params.saving.how has to be equal to 'complete' for idempotent jobs |
10 | | -# # (on clusters) |
11 | | -params.saving.plot = False |
12 | | -params.saving.how_many = 100 |
13 | | -params.saving.how = "complete" |
14 | | -params.saving.postfix = "surface_tracking_example" |
| 41 | +params.saving.how = "recompute" |
| 42 | +# params.saving.path = str(self.path_out) |
| 43 | +params.saving.postfix = "examples" |
15 | 44 |
|
16 | 45 | topology = Topology(params, logging_level="info") |
17 | 46 | # topology.make_code_graphviz('topo.dot') |
18 | | -seq = False |
19 | | -topology.compute(sequential=seq) |
20 | 47 |
|
21 | | -# not generating plots if seq mode is false |
22 | | -if not seq: |
23 | | - params.saving.plot = False |
| 48 | +topology.compute(executor="exec_sequential") |
0 commit comments