Nabu merge requestshttps://gitlab.esrf.fr/tomotools/nabu/-/merge_requests2023-12-14T13:46:02+01:00https://gitlab.esrf.fr/tomotools/nabu/-/merge_requests/213Unsharp mask: add "imagej" mode2023-12-14T13:46:02+01:00Pierre PaleoUnsharp mask: add "imagej" mode## About
This MR adds a new unsharp mask mode, compatible with the one of ImageJ.
## To do
- [x] Add `mode="imagej"` for `UnsharpMask`
- [x] Add `mode="imagej"` for `CudaUnsharpMask`
- [x] Add `mode="imagej"` for `OpenclUnsharpM...## About
This MR adds a new unsharp mask mode, compatible with the one of ImageJ.
## To do
- [x] Add `mode="imagej"` for `UnsharpMask`
- [x] Add `mode="imagej"` for `CudaUnsharpMask`
- [x] Add `mode="imagej"` for `OpenclUnsharpMask`
- [x] Unit tests
- [x] Integrate in pipeline
- [x] (Bonus) Fix app.reconstruct entry point
- [x] (Bonus) Fix NXProcessWriter with histogram: don't make histogram the default view
- [x] End-to-end reconstruction test
## Notes
Imagej Unsharp Mask plugin is [available here](https://imagej.nih.gov/ij/source/ij/plugin/filter/UnsharpMask.java):
```java
/** Unsharp Mask filtering of a float image. 'fp' must have a valid snapshot. */
public void sharpenFloat(FloatProcessor fp, double sigma, float weight) {
if (gb == null) gb = new GaussianBlur();
gb.blurGaussian(fp, sigma, sigma, 0.01);
if (Thread.currentThread().isInterrupted()) return;
float[] pixels = (float[])fp.getPixels();
float[] snapshotPixels = (float[])fp.getSnapshotPixels();
int width = fp.getWidth();
Rectangle roi = fp.getRoi();
for (int y=roi.y; y<roi.y+roi.height; y++)
for (int x=roi.x, p=width*y+x; x<roi.x+roi.width; x++,p++)
pixels[p] = (snapshotPixels[p] - weight*pixels[p])/(1f - weight);
}
```R 2023.1.0https://gitlab.esrf.fr/tomotools/nabu/-/merge_requests/102Rotate projections2021-03-16T12:22:25+01:00Pierre PaleoRotate projections## About
This MR adds the ability to rotate the projection images in the full-field pipeline. It also provides a general-purpose image rotation in the library.
Close #210
## To do
- [x] Implement `Rotation`
- [x] Implement `Cuda...## About
This MR adds the ability to rotate the projection images in the full-field pipeline. It also provides a general-purpose image rotation in the library.
Close #210
## To do
- [x] Implement `Rotation`
- [x] Implement `CudaRotation`
- [x] Unit tests
- [x] Integrate in nabu config and process config
- [x] Integrate in `FullFieldPipeline`
- [x] Integrate in `CudaFullFieldPipeline`
- [x] Integrate in `CudaFullFieldPipelineLimitedMemory`
- [x] End-to-end reconstruction test
## Notes
- The python-numpy backend will require `scikit-image`, as its rotation function is both faster and more flexible (rotation center) than the one of `scipy`.
- It would have been ideal to use `arrayfire` for the cuda backend, but its rotation function does not allow for choosing the center.Release 2021.1.0