Skip to content

Commit dc37dca

Browse files
authored
add BMP (#689)
* add BMP * changelog * rm todo
1 parent 09f12b9 commit dc37dca

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

wkcuber/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ For upgrade instructions, please check the respective *Breaking Changes* section
1212
### Breaking Changes
1313

1414
### Added
15+
- Added support for converting `.bmp` image files. [#689](https://github.com/scalableminds/webknossos-libs/pull/689)
1516

1617
### Changed
1718

wkcuber/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The tools are modular components to allow easy integration into existing pipelin
1414
* `wkcuber`: Convert supported input files to fully ready WKW datasets (includes type detection, downsampling, compressing and metadata generation)
1515
* `wkcuber.convert_image_stack_to_wkw`: Convert image stacks to fully ready WKW datasets (includes downsampling, compressing and metadata generation)
1616
* `wkcuber.export_wkw_as_tiff`: Convert WKW datasets to a tiff stack (writing as tiles to a `z/y/x.tiff` folder structure is also supported)
17-
* `wkcuber.cubing`: Convert image stacks (e.g., `tiff`, `jpg`, `png`, `dm3`, `dm4`) to WKW cubes
17+
* `wkcuber.cubing`: Convert image stacks (e.g., `tiff`, `jpg`, `png`, `bmp`, `dm3`, `dm4`) to WKW cubes
1818
* `wkcuber.tile_cubing`: Convert tiled image stacks (e.g. in `z/y/x.ext` folder structure) to WKW cubes
1919
* `wkcuber.convert_knossos`: Convert KNOSSOS cubes to WKW cubes
2020
* `wkcuber.convert_nifti`: Convert NIFTI files to WKW files (Currently without applying transformations).

wkcuber/wkcuber/image_readers.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1+
import logging
12
from pathlib import Path
2-
from typing import Tuple, Dict, Union, Optional
3+
from typing import Dict, Optional, Tuple, Union
34

45
import numpy as np
5-
import logging
6+
from czifile import CziFile
67
from PIL import Image
8+
from tifffile import TiffFile
79

810
from .vendor.dm3 import DM3
911
from .vendor.dm4 import DM4File, DM4TagHeader
10-
from tifffile import TiffFile
11-
from czifile import CziFile
1212

1313
# Disable PIL's maximum image limit.
1414
Image.MAX_IMAGE_PIXELS = None
@@ -779,6 +779,7 @@ def __init__(self) -> None:
779779
".mj2": PillowImageReader(),
780780
# Other image file endings
781781
".png": PillowImageReader(),
782+
".bmp": PillowImageReader(),
782783
".dm3": Dm3ImageReader(),
783784
".dm4": Dm4ImageReader(),
784785
".czi": CziImageReader(),

0 commit comments

Comments
 (0)