NT-MDT palette format: GraphViz block diagram (.dot) source

It is a color scheme for visualising SPM scans.

Application

["Nova", "Image Analysis", "NanoEducator"]

File extension

pal

KS implementation details

License: Unlicense

This page hosts a formal specification of NT-MDT palette format using Kaitai Struct. This specification can be automatically translated into a variety of programming languages to get a parsing library.

GraphViz block diagram source

nt_mdt_pal.dot

digraph {
	rankdir=LR;
	node [shape=plaintext];
	subgraph cluster__nt_mdt_pal {
		label="NtMdtPal";
		graph[style=dotted];

		nt_mdt_pal__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
			<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
			<TR><TD PORT="signature_pos">0</TD><TD PORT="signature_size">26</TD><TD>4E 54 2D 4D 44 54 20 50 61 6C 65 74 74 65 20 46 69 6C 65 20 20 31 2E 30 30 21</TD><TD PORT="signature_type">signature</TD></TR>
			<TR><TD PORT="count_pos">26</TD><TD PORT="count_size">4</TD><TD>u4be</TD><TD PORT="count_type">count</TD></TR>
			<TR><TD PORT="meta_pos">30</TD><TD PORT="meta_size">16</TD><TD>Meta</TD><TD PORT="meta_type">meta</TD></TR>
			<TR><TD COLSPAN="4" PORT="meta__repeat">repeat count times</TD></TR>
			<TR><TD PORT="something2_pos">...</TD><TD PORT="something2_size">1</TD><TD></TD><TD PORT="something2_type">something2</TD></TR>
			<TR><TD PORT="tables_pos">...</TD><TD PORT="tables_size">...</TD><TD>ColTable</TD><TD PORT="tables_type">tables</TD></TR>
			<TR><TD COLSPAN="4" PORT="tables__repeat">repeat count times</TD></TR>
		</TABLE>>];
		subgraph cluster__meta {
			label="NtMdtPal::Meta";
			graph[style=dotted];

			meta__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="unkn00_pos">0</TD><TD PORT="unkn00_size">3</TD><TD></TD><TD PORT="unkn00_type">unkn00</TD></TR>
				<TR><TD PORT="unkn01_pos">3</TD><TD PORT="unkn01_size">2</TD><TD></TD><TD PORT="unkn01_type">unkn01</TD></TR>
				<TR><TD PORT="unkn02_pos">5</TD><TD PORT="unkn02_size">1</TD><TD></TD><TD PORT="unkn02_type">unkn02</TD></TR>
				<TR><TD PORT="unkn03_pos">6</TD><TD PORT="unkn03_size">1</TD><TD></TD><TD PORT="unkn03_type">unkn03</TD></TR>
				<TR><TD PORT="colors_count_pos">7</TD><TD PORT="colors_count_size">2</TD><TD>u2le</TD><TD PORT="colors_count_type">colors_count</TD></TR>
				<TR><TD PORT="unkn10_pos">9</TD><TD PORT="unkn10_size">2</TD><TD></TD><TD PORT="unkn10_type">unkn10</TD></TR>
				<TR><TD PORT="unkn11_pos">11</TD><TD PORT="unkn11_size">1</TD><TD></TD><TD PORT="unkn11_type">unkn11</TD></TR>
				<TR><TD PORT="unkn12_pos">12</TD><TD PORT="unkn12_size">2</TD><TD></TD><TD PORT="unkn12_type">unkn12</TD></TR>
				<TR><TD PORT="name_size_pos">14</TD><TD PORT="name_size_size">2</TD><TD>u2be</TD><TD PORT="name_size_type">name_size</TD></TR>
			</TABLE>>];
		}
		subgraph cluster__color {
			label="NtMdtPal::Color";
			graph[style=dotted];

			color__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="red_pos">0</TD><TD PORT="red_size">1</TD><TD>u1</TD><TD PORT="red_type">red</TD></TR>
				<TR><TD PORT="unkn_pos">1</TD><TD PORT="unkn_size">1</TD><TD>u1</TD><TD PORT="unkn_type">unkn</TD></TR>
				<TR><TD PORT="blue_pos">2</TD><TD PORT="blue_size">1</TD><TD>u1</TD><TD PORT="blue_type">blue</TD></TR>
				<TR><TD PORT="green_pos">3</TD><TD PORT="green_size">1</TD><TD>u1</TD><TD PORT="green_type">green</TD></TR>
			</TABLE>>];
		}
		subgraph cluster__col_table {
			label="NtMdtPal::ColTable";
			graph[style=dotted];

			col_table__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="size1_pos">0</TD><TD PORT="size1_size">1</TD><TD>u1</TD><TD PORT="size1_type">size1</TD></TR>
				<TR><TD PORT="unkn_pos">1</TD><TD PORT="unkn_size">1</TD><TD>u1</TD><TD PORT="unkn_type">unkn</TD></TR>
				<TR><TD PORT="title_pos">2</TD><TD PORT="title_size">_root.meta[index].name_size</TD><TD>str(UTF-16)</TD><TD PORT="title_type">title</TD></TR>
				<TR><TD PORT="unkn1_pos">...</TD><TD PORT="unkn1_size">2</TD><TD>u2be</TD><TD PORT="unkn1_type">unkn1</TD></TR>
				<TR><TD PORT="colors_pos">...</TD><TD PORT="colors_size">4</TD><TD>Color</TD><TD PORT="colors_type">colors</TD></TR>
				<TR><TD COLSPAN="4" PORT="colors__repeat">repeat (_root.meta[index].colors_count - 1) times</TD></TR>
			</TABLE>>];
		}
	}
	nt_mdt_pal__seq:meta_type -> meta__seq [style=bold];
	nt_mdt_pal__seq:count_type -> nt_mdt_pal__seq:meta__repeat [color="#404040"];
	nt_mdt_pal__seq:tables_type -> col_table__seq [style=bold];
	nt_mdt_pal__seq:count_type -> nt_mdt_pal__seq:tables__repeat [color="#404040"];
	meta__seq:name_size_type -> col_table__seq:title_size [color="#404040"];
	col_table__seq:colors_type -> color__seq [style=bold];
	meta__seq:colors_count_type -> col_table__seq:colors__repeat [color="#404040"];
}