generated from ArcanaFramework/fileformats-extension-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from ArcanaFramework/develop
Adding ITK supported formats
- Loading branch information
Showing
3 changed files
with
89 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import typing as ty | ||
from fileformats.core.mixin import WithMagicNumber | ||
from fileformats.image import ( | ||
RasterImage, | ||
VectorImage, | ||
Bitmap, | ||
Jpeg, | ||
Tiff, | ||
) | ||
from fileformats.application import Dicom, Gzip | ||
from .nifti import Nifti1, NiftiGz | ||
|
||
|
||
class GDCM(Dicom): | ||
pass | ||
|
||
|
||
class GIPL(RasterImage): | ||
ext = ".gipl" | ||
|
||
|
||
class VTK(VectorImage): | ||
ext = ".vtk" | ||
|
||
|
||
class PGM(RasterImage): | ||
ext = ".pgm" | ||
|
||
|
||
class MetaImage(RasterImage): | ||
ext = ".mhd" | ||
|
||
|
||
class Nrrd(WithMagicNumber, RasterImage): | ||
|
||
ext = ".nrrd" | ||
alternate_exts = (".nhdr",) | ||
magic_number = b"NRRD" | ||
|
||
|
||
class NrrdGz(Gzip[Nrrd]): | ||
|
||
ext = ".nrrd.gz" | ||
alternate_exts = (".nhdr.gz",) | ||
|
||
|
||
ItkSupported = ty.Union[ | ||
Nifti1, NiftiGz, Dicom, Bitmap, Tiff, Jpeg, GIPL, MetaImage, Nrrd, NrrdGz, PGM, VTK | ||
] |