From 3ee19800c979de67d3c86b2371c6a743ad094f4a Mon Sep 17 00:00:00 2001 From: "philippe.bernet" Date: Thu, 2 Dec 2021 14:15:37 +0100 Subject: [PATCH] feat(all): update imageJ plugin to handle HOLO v4 --- ImageJ/Holo/About_.java | 2 +- ImageJ/Holo/Open_Holo.class | Bin 5804 -> 5830 bytes ImageJ/Holo/Open_Holo.java | 6 +++--- ImageJ/Holo/Save_Holo.class | Bin 4853 -> 4853 bytes ImageJ/Holo/Save_Holo.java | 2 +- Matlab/Write_Holo.m | 2 +- Python/holo.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ImageJ/Holo/About_.java b/ImageJ/Holo/About_.java index 5a35fa2..383a834 100644 --- a/ImageJ/Holo/About_.java +++ b/ImageJ/Holo/About_.java @@ -9,7 +9,7 @@ public class About_ implements PlugIn { - private String version = "1.0.6"; + private String version = "1.0.7"; private String holo_file_specification_link = "https://ftp.espci.fr/incoming/Atlan/holovibes/holo/HoloFileSpecification.pdf"; private String github_repository = "https://github.com/DigitalHolography/ImportExportScriptsForHoloFiles"; diff --git a/ImageJ/Holo/Open_Holo.class b/ImageJ/Holo/Open_Holo.class index ef21e83c9cc166f5da546349fc6cb5f2028dea33..e273d16652bd4a4f35183d757c3a0791323d00a2 100644 GIT binary patch delta 260 zcmW-bKTASk9EG3XRj*W9m$J!AMB~l-5h5xg`VJ8Wsbzni0*97{itswTLRpj&L1mXH zbc~jutvRGd$%gs_67=G7&a<3{voP2ur!xtGDQz~v7*hIAW>5}^F zF9urDR+|G8DUW^198l$u8b>@*;0ccxioBs{QsPVZ56Ap*A|sS#l2b`?F1uXF9#uKx oQa-qn7I)I-TE4lJUus4Szxyz+EX(cfFcTj$;vMemvsT9Z2hr$4A^-pY delta 240 zcmW-by-Px29EG3X)q4x_;}Q~qP0|p?#nB-m>Tif>%OSIC4YgS0Zp9@fULgzmKq9g3 zASf=)wKN5SEj76{2ZD<)E$6@k&*8i~zSF9PVqGi*aFZR9(~I|*L0`2(M{5bP%(KG^ zIab+a9hVLAn(k?`&$gB(FsEkcVm1Z`9O}$KAf*>AFiho!Pujm>Q`9ix1$xp~rRZ|D z#3`4YQRAFC9!)OjQ0A2iZzw*g@}qme6@S!ZhHFW4Bb(exfjcSkARcx3;8A+KNS}s$ d(UfnVjUfL2uVb}fJCjTCgb^R{)ZVgl))-`UJhcD- diff --git a/ImageJ/Holo/Open_Holo.java b/ImageJ/Holo/Open_Holo.java index 96c84dc..db342d1 100644 --- a/ImageJ/Holo/Open_Holo.java +++ b/ImageJ/Holo/Open_Holo.java @@ -97,7 +97,7 @@ private int check_data_integrity() { if (magic_number != 1330401096) // 1330401096 == "HOLO" return 1; - if (version != 2 && version != 1 && version != 0) // TODO: Manage other version of holo files + if (version != 4 && version != 2 && version != 1 && version != 0) // TODO: Manage other version of holo files return 2; if (bit_depth != 8 && bit_depth != 16 && bit_depth != 24) return 3; @@ -130,7 +130,7 @@ private void parse_header(InputStream is) throws IOException version = (int)(u_hdr[4] | (u_hdr[5] << 8)); // Reading last bytes from header - if (version == 2 || version == 1) + if (version == 4 || version == 2 || version == 1) { read_bytes = is.read(buf, 6, 58); // 58 + 6 = 64 total header bytes if (read_bytes != 58) @@ -157,7 +157,7 @@ else if (version == 0) data_size = (long)width * height * num_frames * (bit_depth / 8); endianness = 0; - if (version == 2 || version == 1) + if (version == 4 || version == 2 || version == 1) { data_size = (long)(u_hdr[20] | (u_hdr[21] << 8) | (u_hdr[22] << 16) | (u_hdr[23] << 24) | (u_hdr[24] << 32) | (u_hdr[25] << 40) | (u_hdr[26] << 48) | (u_hdr[27] << 56)); diff --git a/ImageJ/Holo/Save_Holo.class b/ImageJ/Holo/Save_Holo.class index 5bb6a56a2b2ed04b7c2987785a33dda7b4b6f211..c9af6dcc5a5123b0a36f6ec95a4560354ae68564 100644 GIT binary patch delta 14 VcmeyW`c-v91P>$o=1877Yyd4b1q%QG delta 14 VcmeyW`c-v91P>$Y=1877Yyd4P1qlEE diff --git a/ImageJ/Holo/Save_Holo.java b/ImageJ/Holo/Save_Holo.java index 379f2b6..68bebd8 100644 --- a/ImageJ/Holo/Save_Holo.java +++ b/ImageJ/Holo/Save_Holo.java @@ -73,7 +73,7 @@ private void writeImage(ImagePlus imp) throws IOException // Get header informations from current images stacks magic_number = "HOLO"; - version = 2; + version = 4; bit_depth = imp.getBitDepth(); width = imp.getWidth(); height = imp.getHeight(); diff --git a/Matlab/Write_Holo.m b/Matlab/Write_Holo.m index a57225c..d37ce3f 100644 --- a/Matlab/Write_Holo.m +++ b/Matlab/Write_Holo.m @@ -55,7 +55,7 @@ function Write_Holo(input_array, filepath) %%Write the header fwrite(fd, 'HOLO'); % Magic number, always set to "HOLO" -fwrite(fd, 2, 'uint16'); % Version of holo file +fwrite(fd, 4, 'uint16'); % Version of holo file fwrite(fd, bit_depth, 'uint16'); % Bit depth of data fwrite(fd, frame_width, 'uint32'); % Width of a frame fwrite(fd, frame_height, 'uint32'); % Height of a frame diff --git a/Python/holo.py b/Python/holo.py index 1a688c3..1b2a92d 100644 --- a/Python/holo.py +++ b/Python/holo.py @@ -2,7 +2,7 @@ from struct import pack, unpack import numpy as np -holo_header_version = 2 +holo_header_version = 4 holo_header_size = 64 holo_header_padding_size = 35