M17: ImageJ/FIJI feature parity batch 2 — 8 more features (327 tests)
1. File Formats: FITS reader (BITPIX 8/16/32/-32/-64, BZERO/BSCALE), AVI reader/writer (uncompressed RIFF), raw binary import 2. Image Calculator: 13 operations (Add/Sub/Mul/Div/AND/OR/XOR/Min/Max/ Average/Difference/Copy/Transparent-zero), stack calculator 3. Auto-Threshold: 12 new methods (Huang, Intermodes, Li, MaxEntropy, Mean, MinError, Minimum, Moments, Percentile, RenyiEntropy, Shanbhag, Yen) 4. Background: sliding paraboloid, create_background, light_background option 5. Multi-point Counter: cell counting with categories, CSV export, auto-detect 6. Stack Statistics: per-slice stats, z/t profiles, kymograph extraction 7. Annotations (new ri-annotation crate): text/arrow/scale_bar with 8x8 bitmap font, burn_annotations to pixel data 8. Batch Processing: process_directory, convert_directory, batch_measure, recursive processing with progress callbacks
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
pub mod avi;
|
||||
pub mod dicom;
|
||||
pub mod fits;
|
||||
pub mod nifti;
|
||||
pub mod raw_import;
|
||||
|
||||
use std::path::Path;
|
||||
|
||||
@@ -87,6 +90,9 @@ pub fn save_image(
|
||||
}
|
||||
|
||||
match ext.as_str() {
|
||||
"avi" => {
|
||||
return avi::save_avi(hyperstack, path);
|
||||
}
|
||||
"png" => {
|
||||
let file = std::fs::File::create(path)?;
|
||||
let mut encoder = png::Encoder::new(file, w, h);
|
||||
@@ -148,6 +154,12 @@ pub fn load_image(path: &Path) -> Result<Hyperstack, RiError> {
|
||||
if path_lower.ends_with(".nii") || path_lower.ends_with(".nii.gz") {
|
||||
return nifti::load_nifti(path);
|
||||
}
|
||||
if path_lower.ends_with(".fits") || path_lower.ends_with(".fit") || path_lower.ends_with(".fts") {
|
||||
return fits::load_fits(path);
|
||||
}
|
||||
if path_lower.ends_with(".avi") {
|
||||
return avi::load_avi(path);
|
||||
}
|
||||
|
||||
let img = image::open(path).map_err(|e| RiError::ImageDecode(e.to_string()))?;
|
||||
let file_size_bytes = std::fs::metadata(path).map(|m| m.len()).ok();
|
||||
|
||||
Reference in New Issue
Block a user