Mercurial > repos > imgteam > libcarna_render
comparison render.py @ 4:a9f10dceb17e draft default tip
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/libcarna/ commit 99d6ebe67515f1362ea4412b143ab2a140c8d631
| author | imgteam |
|---|---|
| date | Tue, 13 Jan 2026 12:21:55 +0000 |
| parents | 31a2e1909ae5 |
| children |
comparison
equal
deleted
inserted
replaced
| 3:31a2e1909ae5 | 4:a9f10dceb17e |
|---|---|
| 68 intensities = tool.args.input_images['intensities'] | 68 intensities = tool.args.input_images['intensities'] |
| 69 intensities_volume = libcarna.volume( | 69 intensities_volume = libcarna.volume( |
| 70 GEOMETRY_TYPE_INTENSITIES, | 70 GEOMETRY_TYPE_INTENSITIES, |
| 71 intensities.normalize_axes_like(tool.args.params['axes']).data, | 71 intensities.normalize_axes_like(tool.args.params['axes']).data, |
| 72 parent=root, | 72 parent=root, |
| 73 units=tool.args.params['units'], | |
| 73 spacing=[ | 74 spacing=[ |
| 74 { | 75 { |
| 75 'X': intensities.metadata.pixel_size[0] or 1, | 76 'X': intensities.metadata.pixel_size[0] or 1, |
| 76 'Y': intensities.metadata.pixel_size[1] or 1, | 77 'Y': intensities.metadata.pixel_size[1] or 1, |
| 77 'Z': intensities.metadata.z_spacing or 1, | 78 'Z': intensities.metadata.z_spacing or 1, |
| 121 ): | 122 ): |
| 122 ramp_values.append( | 123 ramp_values.append( |
| 123 value if val_type == 'relative' else intensities_volume.normalized(value), | 124 value if val_type == 'relative' else intensities_volume.normalized(value), |
| 124 ) | 125 ) |
| 125 cmap_kwargs['ramp'] = tuple(ramp_values) | 126 cmap_kwargs['ramp'] = tuple(ramp_values) |
| 127 cmap_kwargs['n_samples'] = 1000 # high precision is required when sampling ramps to avoid "soft" corners | |
| 126 mode.cmap(tool.args.params['colormap'], **cmap_kwargs) | 128 mode.cmap(tool.args.params['colormap'], **cmap_kwargs) |
| 127 | 129 |
| 128 # Render | 130 # Render |
| 129 colorbars = list() | 131 colorbars = list() |
| 130 if tool.args.params['colorbar']: | 132 if tool.args.params['colorbar']: |
