Wiki source code of Access data with ImageJ
Last modified by fwilde on 2018/12/18 12:01
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
3.1 | 1 | {{layout}} |
2 | {{layout-section ac:type="two_right_sidebar"}} | ||
3 | {{layout-cell}} | ||
![]() |
15.1 | 4 | {{info}} |
![]() |
16.1 | 5 | **As of 2017, all images are stored in TIFF format. These can be easily viewed with many image viewers including ImageJ.** |
![]() |
15.1 | 6 | {{/info}} |
![]() |
1.1 | 7 | |
![]() |
15.1 | 8 | Until 2017 at P05 a generic data format was used to store raw and reconstructed data. This is a binary format in little endian byte order with different data types (uint16, real32, ...) and a header which describes the dataset (rows and columns, data format). This data can either be imported directly in ImageJ or loaded with our plugins. |
9 | |||
![]() |
8.1 | 10 | = {{id name="AccessdatawithImageJ-Readthefileheader"/}}Read the file header = |
![]() |
1.1 | 11 | |
![]() |
8.1 | 12 | Each image contains a header consisting of the information needed to open the binary raw file. To read the header open the first line of the dataset (e.g. with the {{code language="none"}}head{{/code}} command in Linux or in an editor). The header information is subdivided with underscore symbols, like e.g. {{code language="none"}}PC_2_U_2000_2000_{{/code}}. The first item describes on what kind of computer the data was generated. The second item shows the dimensionailty of the data (2 for an image). The next item is a letter (either B U I L or F ) and describes the data type. A list of te data types can be found in the table below. The last items give the length of the dataset in each dimension. The total header length is not fixed and generally depends on the image dimensions.and count all letters until the carriage return. Add 2 to this number (carriage return has two letters) and this is the header length - e.g. {{code language="none"}}PC_2_U_2000_2000_{{/code}} has 17 letters ansd thus results in a header length of 19. |
![]() |
1.1 | 13 | |
![]() |
11.1 | 14 | (% class="wrapped" %) |
![]() |
1.1 | 15 | |=((( |
16 | suffix | ||
17 | )))|=((( | ||
![]() |
9.1 | 18 | ImageJ data type |
![]() |
1.1 | 19 | )))|=((( |
20 | header tag | ||
21 | ))) | ||
22 | |((( | ||
![]() |
15.1 | 23 | \\ |
![]() |
1.1 | 24 | )))|((( |
![]() |
9.1 | 25 | 8 bit |
![]() |
1.1 | 26 | )))|((( |
27 | B | ||
28 | ))) | ||
29 | |((( | ||
30 | .img .dar .ref | ||
31 | )))|((( | ||
![]() |
9.1 | 32 | 16 bit Unsigned |
![]() |
1.1 | 33 | )))|((( |
34 | U | ||
35 | ))) | ||
36 | |((( | ||
![]() |
15.1 | 37 | \\ |
![]() |
1.1 | 38 | )))|((( |
![]() |
9.1 | 39 | 16 bit Signed |
![]() |
1.1 | 40 | )))|((( |
41 | I | ||
42 | ))) | ||
43 | |((( | ||
![]() |
15.1 | 44 | \\ |
![]() |
1.1 | 45 | )))|((( |
![]() |
9.1 | 46 | 32 bit Signed |
![]() |
1.1 | 47 | )))|((( |
48 | L | ||
49 | ))) | ||
50 | |((( | ||
51 | .sli .sin .sis | ||
52 | )))|((( | ||
![]() |
9.1 | 53 | 32 bit Real |
![]() |
1.1 | 54 | )))|((( |
55 | F | ||
56 | ))) | ||
57 | |||
![]() |
8.1 | 58 | = {{id name="AccessdatawithImageJ-Importrawdatadirectly"/}}Import raw data directly = |
59 | |||
![]() |
10.1 | 60 | With ImageJ you can import binary data directly using {{code language="none"}}File > Import > Raw...{{/code}}. To import the raw data directly, read the header of the file you want to open, enter the values: |
![]() |
8.1 | 61 | |
![]() |
10.1 | 62 | * Image type (see table ImageJ data type) |
63 | * Width and height (last two numbers in header) | ||
64 | * Offset to first image (i.e. header length) | ||
65 | |||
66 | and check the box {{code language="none"}}Little-endian byte order{{/code}}. You can choose to {{code language="none"}}Open all files in folder{{/code}} if you want to open a stack with all file in a folder. **Attention**: {{code language="none"}}Use virtual stack{{/code}} does not work with this kind of import. To open a virtual stack you need to use our plugins. | ||
67 | |||
![]() |
8.1 | 68 | [[image:attach:imagej_raw_import.png||height="250"]] |
69 | |||
![]() |
1.1 | 70 | = {{id name="AccessdatawithImageJ-UsetheImageJplugins"/}}Use the ImageJ plugins = |
71 | |||
![]() |
13.1 | 72 | In order to read the P05 data with our plugin, you have at least to install the {{code language="none"}}read_dat.class{{/code}}. Simply copy the file into your local ImageJ plugins folder. If you want to be able to open the data with the standard {{code language="none"}}File -> Open...{{/code}} Menu button, you addtionally have to install the ##(% style="color: rgb(0,0,0);" %)HandeExtraFileTypes.class(%%)##(% style="color: rgb(0,0,0);" %). With this plugin you can also import an image stack as a virtual stack. |
![]() |
1.1 | 73 | |
![]() |
8.1 | 74 | {{info}} |
75 | There appear to be some issues with our plugins using Fiji (ImageJ with extended plugins). If you are using Fiji and encounter problems with our plugins try using ImageJ instead. | ||
76 | {{/info}} | ||
77 | |||
78 | (% style="color: rgb(0,0,0);" %) | ||
79 | |||
80 | |||
![]() |
4.1 | 81 | = {{id name="AccessdatawithImageJ-Downloads"/}}Downloads = |
![]() |
1.1 | 82 | |
![]() |
11.1 | 83 | {{panel borderColor="blue" titleColor="white" titleBGColor="blue" title="ImageJ Plugins"}} |
![]() |
6.1 | 84 | **Binary files to copy to your plugin folder:** |
85 | |||
![]() |
11.1 | 86 | [[attach:HandleExtraFileTypes.class]] |
87 | |||
![]() |
8.1 | 88 | [[attach:read_dat.class]] |
![]() |
6.1 | 89 | |
90 | **Source code:** | ||
91 | |||
92 | [[attach:HandleExtraFileTypes.java]] | ||
93 | |||
94 | [[attach:read_dat.java]] | ||
![]() |
2.1 | 95 | {{/panel}} |
![]() |
6.1 | 96 | |
![]() |
15.1 | 97 | \\ |
![]() |
6.1 | 98 | |
![]() |
15.1 | 99 | \\ |
![]() |
3.1 | 100 | {{/layout-cell}} |
101 | |||
102 | {{layout-cell}} | ||
103 | |||
104 | |||
105 | {{toc/}} | ||
106 | {{/layout-cell}} | ||
107 | {{/layout-section}} | ||
108 | {{/layout}} |