lls-core 2.2.1__tar.gz → 2.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. {lls_core-2.2.1 → lls_core-2.2.2}/PKG-INFO +1 -1
  2. lls_core-2.2.2/lls_core/kernels/affine_transform_deskew_x_shear_only_3d_x.cl +86 -0
  3. lls_core-2.2.2/lls_core/kernels/affine_transform_deskew_y_shear_only_3d_x.cl +91 -0
  4. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core.egg-info/PKG-INFO +1 -1
  5. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core.egg-info/SOURCES.txt +2 -0
  6. {lls_core-2.2.1 → lls_core-2.2.2}/pyproject.toml +4 -1
  7. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/__init__.py +0 -0
  8. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/cmds/__init__.py +0 -0
  9. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/cmds/__main__.py +0 -0
  10. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/config.py +0 -0
  11. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/cropping.py +0 -0
  12. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/czi_reader.py +0 -0
  13. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/deconvolution.py +0 -0
  14. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/estimate.py +0 -0
  15. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/llsz_core.py +0 -0
  16. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/metadata.py +0 -0
  17. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/mip.py +0 -0
  18. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/models/__init__.py +0 -0
  19. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/models/crop.py +0 -0
  20. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/models/deconvolution.py +0 -0
  21. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/models/deskew.py +0 -0
  22. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/models/lattice_data.py +0 -0
  23. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/models/output.py +0 -0
  24. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/models/results.py +0 -0
  25. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/models/utils.py +0 -0
  26. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/sample/__init__.py +0 -0
  27. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/shear_only_deskew.py +0 -0
  28. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/shear_only_geometry.py +0 -0
  29. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/types.py +0 -0
  30. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/utils.py +0 -0
  31. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/workflow.py +0 -0
  32. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core/writers.py +0 -0
  33. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core.egg-info/dependency_links.txt +0 -0
  34. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core.egg-info/entry_points.txt +0 -0
  35. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core.egg-info/requires.txt +0 -0
  36. {lls_core-2.2.1 → lls_core-2.2.2}/lls_core.egg-info/top_level.txt +0 -0
  37. {lls_core-2.2.1 → lls_core-2.2.2}/setup.cfg +0 -0
  38. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_arg_parser.py +0 -0
  39. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_cli.py +0 -0
  40. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_crop_deskew.py +0 -0
  41. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_crop_placement.py +0 -0
  42. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_czi_reader.py +0 -0
  43. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_deconvolution.py +0 -0
  44. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_deskew.py +0 -0
  45. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_memory_warning.py +0 -0
  46. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_metadata_sidecar.py +0 -0
  47. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_mip.py +0 -0
  48. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_output_dtype.py +0 -0
  49. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_parallel_processing.py +0 -0
  50. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_process.py +0 -0
  51. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_roi_units.py +0 -0
  52. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_shear_only.py +0 -0
  53. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_validation.py +0 -0
  54. {lls_core-2.2.1 → lls_core-2.2.2}/tests/test_workflows.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lls_core
3
- Version: 2.2.1
3
+ Version: 2.2.2
4
4
  Summary: Core functionality for analysing and visualizing lattice lightsheet and Oblique Plane Microscopy data.
5
5
  Author: Pradeep Rajasekhar, Lachlan Whitehead, Robert Haase, Michael Milton
6
6
  License: GPL-3.0-only
@@ -0,0 +1,86 @@
1
+ // Coverslip-frame orthogonal deskew — X-skew (single-pass inverse gather).
2
+ //
3
+ // Mirrors the Y-skew coverslip kernel with the sheared axis = X.
4
+ // The raw image has shape (Nz=scan, Ny, Nx); the shear direction is X.
5
+ //
6
+ // FROZEN MAP (mirrors numba X-skew: axis swap 1<->2 then Y-kernel then swap):
7
+ // Inverse gather (per output voxel xc, yc, zc):
8
+ // ss = sintheta * pixel_step (pixel_step = dz/dx)
9
+ // plane = zc / ss (scan-plane index, float)
10
+ // raw_x = xc - zc / tantheta (raw-X column index, float)
11
+ // y = yc (pass-through)
12
+ // Bilinear over nearest (plane, raw_x) neighbours; yc passes through.
13
+ // No zc flip; z0 = x0 = 0.
14
+ //
15
+ // OpenCL image layout for a numpy (Nz=scan, Ny, Nx) array pushed via cle:
16
+ // READ raw[plane, yc, raw_x] -> (int4)(raw_x, yc, plane, 0)
17
+ // WRITE out[zc, yc, xc] -> (int4)(xc, yc, zc, 0)
18
+ //
19
+ // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
20
+
21
+ #ifndef SAMPLER_ADDRESS
22
+ #define SAMPLER_ADDRESS CLK_ADDRESS_CLAMP
23
+ #endif
24
+
25
+ __kernel void
26
+ affine_transform_deskew_x_shear_only_3d(IMAGE_input_TYPE input,
27
+ IMAGE_output_TYPE output,
28
+ float pixel_step,
29
+ float tantheta,
30
+ float sintheta)
31
+ {
32
+ const sampler_t sampler =
33
+ CLK_NORMALIZED_COORDS_FALSE | SAMPLER_ADDRESS | CLK_FILTER_NEAREST;
34
+
35
+ // Output voxel indices (coverslip frame)
36
+ const uint xc = get_global_id(0); // sheared X (coverslip X)
37
+ const uint yc = get_global_id(1); // Y passthrough
38
+ const uint zc = get_global_id(2); // height above coverslip (coverslip Z)
39
+
40
+ // Bounds of the RAW (input) image
41
+ const uint Nz = GET_IMAGE_DEPTH(input); // number of scan planes
42
+ const uint Nx = GET_IMAGE_WIDTH(input); // raw-X columns
43
+
44
+ float pix = 0.0f;
45
+
46
+ if (xc < GET_IMAGE_WIDTH(output) &&
47
+ yc < GET_IMAGE_HEIGHT(output) &&
48
+ zc < GET_IMAGE_DEPTH(output))
49
+ {
50
+ // Inverse map: find the fractional scan-plane and raw-X indices
51
+ const float ss = sintheta * pixel_step; // zc spacing per scan plane
52
+ const float scan = (float)zc / ss; // fractional scan-plane index
53
+ const long plane = (long)floor(scan); // floor scan plane
54
+ const float fp = scan - (float)plane; // fraction between planes
55
+
56
+ const float raw_x = (float)xc - (float)zc / tantheta;
57
+ const long pos = (long)floor(raw_x); // floor raw-X column
58
+ const float fx = raw_x - (float)pos; // fraction between columns
59
+
60
+ // Only fill voxels whose source lies within the raw volume
61
+ if (plane >= 0 && plane + 1 < (long)Nz &&
62
+ pos >= 0 && pos + 1 < (long)Nx)
63
+ {
64
+ // Bilinear interpolation over (plane, plane+1) x (pos, pos+1)
65
+ // raw array layout (Nz=scan, Ny, Nx):
66
+ // READ raw[p, yc, r] -> (int4)(r, yc, p, 0)
67
+ const float p00 = (float)(READ_input_IMAGE(
68
+ input, sampler, (int4)(pos, yc, plane, 0)).x);
69
+ const float p01 = (float)(READ_input_IMAGE(
70
+ input, sampler, (int4)(pos + 1, yc, plane, 0)).x);
71
+ const float p10 = (float)(READ_input_IMAGE(
72
+ input, sampler, (int4)(pos, yc, plane + 1, 0)).x);
73
+ const float p11 = (float)(READ_input_IMAGE(
74
+ input, sampler, (int4)(pos + 1, yc, plane + 1, 0)).x);
75
+
76
+ pix = (1.0f - fp) * (1.0f - fx) * p00
77
+ + (1.0f - fp) * fx * p01
78
+ + fp * (1.0f - fx) * p10
79
+ + fp * fx * p11;
80
+ }
81
+ }
82
+
83
+ // Write to output: WRITE out[zc, yc, xc] -> (int4)(xc, yc, zc, 0)
84
+ WRITE_output_IMAGE(output, (int4)(xc, yc, zc, 0),
85
+ CONVERT_output_PIXEL_TYPE(pix));
86
+ }
@@ -0,0 +1,91 @@
1
+ // Coverslip-frame orthogonal deskew — Y-skew (single-pass inverse gather).
2
+ //
3
+ // Adapted from pyclesperanto_prototype's affine_transform_deskew_y_3d_x.cl
4
+ // (Sapoznik et al. 2020; Maioli 2016) for the coverslip coordinate frame.
5
+ //
6
+ // FROZEN MAP:
7
+ // Forward: zc = sin*step*p, yc = cos*step*p + yr, xc = x
8
+ // Inverse gather (per output voxel xc, yc, zc):
9
+ // ss = sintheta * pixel_step
10
+ // plane = zc / ss (scan-plane index, float)
11
+ // raw_y = yc - zc / tantheta (raw-Y row index, float)
12
+ // x = xc (pass-through)
13
+ // Bilinear over nearest (plane, raw_y) neighbours.
14
+ // No zc flip; z0 = y0 = 0.
15
+ //
16
+ // OpenCL image layout for a numpy (Nz=scan, Ny, Nx) array pushed via cle:
17
+ // READ raw[plane, raw_y, x] -> (int4)(x, raw_y, plane, 0)
18
+ // WRITE out[zc, yc, x] -> (int4)(x, yc, zc, 0)
19
+ //
20
+ // Redistribution and use in source and binary forms, with or without
21
+ // modification, are permitted provided that the following conditions are met:
22
+ // * Redistributions of source code must retain the above copyright notice.
23
+ // * Redistributions in binary form must reproduce the above copyright notice.
24
+ // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
25
+
26
+ #ifndef SAMPLER_ADDRESS
27
+ #define SAMPLER_ADDRESS CLK_ADDRESS_CLAMP
28
+ #endif
29
+
30
+ __kernel void
31
+ affine_transform_deskew_y_shear_only_3d(IMAGE_input_TYPE input,
32
+ IMAGE_output_TYPE output,
33
+ float pixel_step,
34
+ float tantheta,
35
+ float sintheta)
36
+ {
37
+ const sampler_t sampler =
38
+ CLK_NORMALIZED_COORDS_FALSE | SAMPLER_ADDRESS | CLK_FILTER_NEAREST;
39
+
40
+ // Output voxel indices (coverslip frame)
41
+ const uint xc = get_global_id(0); // X passthrough
42
+ const uint yc = get_global_id(1); // sheared lateral (coverslip Y)
43
+ const uint zc = get_global_id(2); // height above coverslip (coverslip Z)
44
+
45
+ // Bounds of the RAW (input) image
46
+ const uint Nz = GET_IMAGE_DEPTH(input); // number of scan planes
47
+ const uint Ny = GET_IMAGE_HEIGHT(input); // raw-Y rows
48
+
49
+ float pix = 0.0f;
50
+
51
+ if (xc < GET_IMAGE_WIDTH(output) &&
52
+ yc < GET_IMAGE_HEIGHT(output) &&
53
+ zc < GET_IMAGE_DEPTH(output))
54
+ {
55
+ // Inverse map: find the fractional scan-plane and raw-Y indices
56
+ const float ss = sintheta * pixel_step; // zc spacing per scan plane
57
+ const float scan = (float)zc / ss; // fractional scan-plane index
58
+ const long plane = (long)floor(scan); // floor scan plane
59
+ const float fp = scan - (float)plane; // fraction between planes
60
+
61
+ const float raw_y = (float)yc - (float)zc / tantheta;
62
+ const long pos = (long)floor(raw_y); // floor raw-Y row
63
+ const float fy = raw_y - (float)pos; // fraction between rows
64
+
65
+ // Only fill voxels whose source lies within the raw volume
66
+ if (plane >= 0 && plane + 1 < (long)Nz &&
67
+ pos >= 0 && pos + 1 < (long)Ny)
68
+ {
69
+ // Bilinear interpolation over (plane, plane+1) x (pos, pos+1)
70
+ // raw array layout (Nz=scan, Ny, Nx):
71
+ // READ raw[p, r, x] -> (int4)(x, r, p, 0)
72
+ const float p00 = (float)(READ_input_IMAGE(
73
+ input, sampler, (int4)(xc, pos, plane, 0)).x);
74
+ const float p01 = (float)(READ_input_IMAGE(
75
+ input, sampler, (int4)(xc, pos + 1, plane, 0)).x);
76
+ const float p10 = (float)(READ_input_IMAGE(
77
+ input, sampler, (int4)(xc, pos, plane + 1, 0)).x);
78
+ const float p11 = (float)(READ_input_IMAGE(
79
+ input, sampler, (int4)(xc, pos + 1, plane + 1, 0)).x);
80
+
81
+ pix = (1.0f - fp) * (1.0f - fy) * p00
82
+ + (1.0f - fp) * fy * p01
83
+ + fp * (1.0f - fy) * p10
84
+ + fp * fy * p11;
85
+ }
86
+ }
87
+
88
+ // Write to output: WRITE out[zc, yc, xc] -> (int4)(xc, yc, zc, 0)
89
+ WRITE_output_IMAGE(output, (int4)(xc, yc, zc, 0),
90
+ CONVERT_output_PIXEL_TYPE(pix));
91
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lls_core
3
- Version: 2.2.1
3
+ Version: 2.2.2
4
4
  Summary: Core functionality for analysing and visualizing lattice lightsheet and Oblique Plane Microscopy data.
5
5
  Author: Pradeep Rajasekhar, Lachlan Whitehead, Robert Haase, Michael Milton
6
6
  License: GPL-3.0-only
@@ -22,6 +22,8 @@ lls_core.egg-info/requires.txt
22
22
  lls_core.egg-info/top_level.txt
23
23
  lls_core/cmds/__init__.py
24
24
  lls_core/cmds/__main__.py
25
+ lls_core/kernels/affine_transform_deskew_x_shear_only_3d_x.cl
26
+ lls_core/kernels/affine_transform_deskew_y_shear_only_3d_x.cl
25
27
  lls_core/models/__init__.py
26
28
  lls_core/models/crop.py
27
29
  lls_core/models/deconvolution.py
@@ -11,7 +11,7 @@ line_length = 79
11
11
 
12
12
  [project]
13
13
  name = "lls_core"
14
- version = "2.2.1"
14
+ version = "2.2.2"
15
15
  authors = [
16
16
  {name = "Pradeep Rajasekhar"},
17
17
  {name = "Lachlan Whitehead"},
@@ -78,6 +78,9 @@ dependencies = [
78
78
  "zarr>=2.16",
79
79
  "numcodecs>=0.11",
80
80
  ]
81
+ # ensures that kernels are included in package distribution
82
+ [tool.setuptools.package-data]
83
+ lls_core = ["kernels/*.cl"]
81
84
 
82
85
  [project.urls]
83
86
  Repository = "https://github.com/BioimageAnalysisCoreWEHI/napari_lattice"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes