diff --git a/.gitignore b/.gitignore
index 0f7ed2ff946aa20cad9cb1d28b0ad6b3d5fee08f..f1351cf6f447c913fea77ca644b4d88e77812db9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,4 +14,6 @@ czi_example_data/
 *.out
 *.bbl
 *.blg
-*.fdb_latexmk
\ No newline at end of file
+*.fdb_latexmk
+.vs/
+[Oo]bj
diff --git a/README.md b/README.md
index c6bebe745e478fb99a1bb22ac1bb1b14f64b893f..775247fdb13f7b23098e0004e38dcc960433d02a 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,7 @@
     - Jaký je vztah mezi obrázky v CZI souboru?
     - Dala by se použít nějaká komprese vzhledem k `referenčním` obrázkům? (vztah mezi obrazy, jak jsou posunuty atd.)
 - Možná se podívat co je to ten HDF5, ale spíš se zaměřit na CZI formát.
+- Jaké obrázky jsou komprimované pomocí B3D a s jakýmy výsledky?
 
 
 <!-- Popsat formát CZI, HDF5
diff --git a/czi-format/inspector/czi-inspector.sln b/czi-format/inspector/czi-inspector.sln
new file mode 100644
index 0000000000000000000000000000000000000000..55ae1e4dfaedb83e549c65dfa88045bb3f2d0e2c
--- /dev/null
+++ b/czi-format/inspector/czi-inspector.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28307.168
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "czi-inspector", "czi-inspector\czi-inspector.csproj", "{CC796EBE-77A0-442F-A44F-0863E03B2F54}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{CC796EBE-77A0-442F-A44F-0863E03B2F54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{CC796EBE-77A0-442F-A44F-0863E03B2F54}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{CC796EBE-77A0-442F-A44F-0863E03B2F54}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{CC796EBE-77A0-442F-A44F-0863E03B2F54}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {E88F4F44-F469-4F79-B35D-08A631D14253}
+	EndGlobalSection
+EndGlobal
diff --git a/czi-format/inspector/czi-inspector/Program.cs b/czi-format/inspector/czi-inspector/Program.cs
new file mode 100644
index 0000000000000000000000000000000000000000..04d40e5d48449e536d26fdb412be152377a2e676
--- /dev/null
+++ b/czi-format/inspector/czi-inspector/Program.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace czi_inspector
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            string file = args[0];
+            string substring = args[1];
+            string encoding = args[2];
+            Regex regex = new Regex(substring, RegexOptions.IgnoreCase);
+            Encoding selectedEncoding = GetEncoding(encoding);
+
+            const int bufferSize = 1024;
+            byte[] buffer = new byte[bufferSize];
+            int count = 0;
+            Stopwatch stopwatch = new Stopwatch();
+            stopwatch.Start();
+
+            //var wholeFileBuffer = File.ReadAllBytes(file);
+            //string wholeFileString = selectedEncoding.GetString(wholeFileBuffer);
+            //count = regex.Matches(substring).Count;
+            using (FileStream reader = new FileStream(file, FileMode.Open, FileAccess.Read))
+            {
+                while (reader.Read(buffer, 0, bufferSize) > 0)
+                {
+                    string bufferString = selectedEncoding.GetString(buffer);
+                        var matches = regex.Matches(bufferString).Count;
+                    count += matches;
+                    if (matches > 0)
+                        Console.WriteLine(bufferString);
+                }
+            }
+            stopwatch.Stop();
+            Console.WriteLine("Found: {0} occurencies of {1} in file {2} in {3} ms.", count, substring, file, stopwatch.Elapsed.TotalMilliseconds);
+
+        }
+
+        private static Encoding GetEncoding(string encoding)
+        {
+            encoding = encoding.ToUpper();
+            if (encoding == "ASCII") return Encoding.ASCII;
+            if (encoding == "UTF8") return Encoding.UTF8;
+            if (encoding == "UNICODE") return Encoding.Unicode;
+            if (encoding == "UTF32") return Encoding.UTF32;
+            throw new Exception("Try different encoding, currently supported: ASCII, UTF8, UTF32, UNICODE.");
+        }
+    }
+}
diff --git a/czi-format/inspector/czi-inspector/czi-inspector.csproj b/czi-format/inspector/czi-inspector/czi-inspector.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..68783fa7bd0fbea2c2ab063e839a1b8c9ea23f77
--- /dev/null
+++ b/czi-format/inspector/czi-inspector/czi-inspector.csproj
@@ -0,0 +1,9 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>netcoreapp2.1</TargetFramework>
+    <RootNamespace>czi_inspector</RootNamespace>
+  </PropertyGroup>
+
+</Project>
diff --git a/document/citations.bib b/document/citations.bib
index ef1a890991de397a39c30519b55f079370856ffd..4a7c8da9c0ffbf30a1d23fc4caee91e964aea1c9 100644
--- a/document/citations.bib
+++ b/document/citations.bib
@@ -3,5 +3,18 @@
     title         = ZISRAW (CZI) File Format",
     year          =  2016,
     number        = "MC33879",
-    note          = "Version 1.2.2"
-}
\ No newline at end of file
+    note          = "Version 1.2.2",
+}
+
+@article {Balazs164624,
+	author = {Balazs, Balint and Deschamps, Joran and Albert, Marvin and Ries, Jonas and Hufnagel, Lars},
+	title = {A real-time compression library for microscopy images},
+	elocation-id = {164624},
+	year = {2017},
+	doi = {10.1101/164624},
+	publisher = {Cold Spring Harbor Laboratory},
+	abstract = {Fluorescence imaging techniques such as single molecule localization microscopy, high-content screening and light-sheet microscopy are producing ever-larger datasets, which poses increasing challenges in data handling and data sharing. Here, we introduce a real-time compression library that allows for very fast (beyond 1 GB/s) compression and de-compression of microscopy datasets during acquisition. In addition to an efficient lossless mode, our algorithm also includes a lossy option, which limits pixel deviations to the intrinsic noise level of the image and yields compression ratio of up to 100-fold. We present a detailed performance analysis of the different compression modes for various biological samples and imaging modalities.},
+	URL = {https://www.biorxiv.org/content/early/2017/07/21/164624},
+	eprint = {https://www.biorxiv.org/content/early/2017/07/21/164624.full.pdf},
+	journal = {bioRxiv}
+}
diff --git a/document/diploma.cls b/document/diploma.cls
new file mode 100644
index 0000000000000000000000000000000000000000..9b34dd238894dc04a25d749744ea86505108be56
--- /dev/null
+++ b/document/diploma.cls
@@ -0,0 +1,547 @@
+%%
+%% This is file `diploma.cls',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% VersionInfo.dtx 
+%% Introduction.dtx 
+%% UserManual.dtx 
+%% ImplementationBeginning.dtx 
+%% Constants.dtx 
+%% VariablesDeclaration.dtx 
+%% BaseClassAndPackages.dtx 
+%% OptionsDeclaration.dtx 
+%% PublicMacros.dtx 
+%% InternalMacros.dtx 
+%% SourceCodeListings.dtx 
+%% ImplementationFinale.dtx 
+%% 
+%% IMPORTANT NOTICE:
+%% 
+%% For the copyright see the source file.
+%% 
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from diploma.cls.
+%% 
+%% For distribution of the original source see the terms
+%% for copying and modification in the file VersionInfo.dtx Introduction.dtx UserManual.dtx ImplementationBeginning.dtx Constants.dtx VariablesDeclaration.dtx BaseClassAndPackages.dtx OptionsDeclaration.dtx PublicMacros.dtx InternalMacros.dtx SourceCodeListings.dtx ImplementationFinale.dtx.
+%% 
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+\def\fileversion{4.03}
+\def\filedate{2017/03/31}
+\def\docdate{31. března 2018}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{diploma}[\filedate\space \fileversion\space diploma LaTeX document class]
+\RequirePackage{ifthen}
+\newcommand{\Dipl@BachelorThesis}{0}
+\newcommand{\Dipl@BachelorPractice}{1}
+\newcommand{\Dipl@MasterThesis}{2}
+\newcommand{\Dipl@PhDThesis}{3}
+\newcommand{\Dipl@CzechLanguage}{0}
+\newcommand{\Dipl@EnglishLanguage}{1}
+\newcommand{\Dipl@SlovakLanguage}{2}
+\newtoks\Dipl@UniversityName
+\Dipl@UniversityName={No university name is given}
+\newtoks\Dipl@FacultyName
+\Dipl@FacultyName={No faculty name is given}
+\newtoks\Dipl@DepartmentName
+\Dipl@DepartmentName={No department name is given}
+\newtoks\Dipl@ThesisAuthor
+\Dipl@ThesisAuthor={No author name is given}
+\newtoks\Dipl@CzechThesisTitle
+\Dipl@CzechThesisTitle={No Czech or Slovak thesis title is given}
+\newtoks\Dipl@EnglishThesisTitle
+\Dipl@EnglishThesisTitle={No English thesis title is given}
+\newtoks\Dipl@SubmissionDate
+\Dipl@SubmissionDate={No submission date is given}
+\newtoks\Dipl@ThesisAssignmentImagePath
+\Dipl@ThesisAssignmentImagePath={}
+\newtoks\Dipl@AuthorDeclaration
+\Dipl@AuthorDeclaration={}
+\newtoks\Dipl@AuthorDeclarationImageFile
+\Dipl@AuthorDeclarationImageFile={}
+\newtoks\Dipl@CooperatingPersonsDeclaration
+\Dipl@CooperatingPersonsDeclaration={}
+\newtoks\Dipl@ThesisAccessRestriction
+\Dipl@ThesisAccessRestriction={}
+\newtoks\Dipl@CooperatingPersonsDeclarationImageFile
+\Dipl@CooperatingPersonsDeclarationImageFile={}
+\newtoks\Dipl@Thanks
+\Dipl@Thanks={}
+\newtoks\Dipl@CzechAbstract
+\Dipl@CzechAbstract={No Czech or Slovak abstract is given}
+\newtoks\Dipl@CzechKeywords
+\Dipl@CzechKeywords={No Czech or Slovak keywords are given}
+\newtoks\Dipl@EnglishAbstract
+\Dipl@EnglishAbstract={No English abstract is given}
+\newtoks\Dipl@EnglishKeywords
+\Dipl@EnglishKeywords={No English keywords are given}
+\newtoks\Dipl@Acronyms
+\Dipl@Acronyms={}
+\newtoks\Dipl@DefaultSourceCodeLanguage
+\Dipl@DefaultSourceCodeLanguage={java}
+\newboolean{Dipl@IsPublicPart}
+\setboolean{Dipl@IsPublicPart}{true}
+\newboolean{Dipl@AuthorIsMale}
+\setboolean{Dipl@AuthorIsMale}{true}
+\newboolean{Dipl@PrintCooperatingPersonsDeclaration}
+\setboolean{Dipl@PrintCooperatingPersonsDeclaration}{false}
+\newboolean{Dipl@IsAppendix}
+\setboolean{Dipl@IsAppendix}{false}
+\newcounter{Dipl@CurrentThesisType}
+\setcounter{Dipl@CurrentThesisType}{\Dipl@MasterThesis}
+\newcounter{Dipl@CurrentThesisLanguage}
+\setcounter{Dipl@CurrentThesisLanguage}{\Dipl@CzechLanguage}
+\newcounter{Dipl@ThesisAssignmentImageCounter}
+\LoadClass[11pt]{article}
+\RequirePackage[czech,english,slovak]{babel}
+\RequirePackage[T1]{fontenc}
+\RequirePackage{lmodern}
+\RequirePackage[a4paper,includefoot,nohead,marginparwidth=0mm,marginparsep=0mm,left=30mm,right=20mm,top=30mm,bottom=30mm]{geometry}
+\RequirePackage{booktabs}
+\RequirePackage{graphicx}
+\RequirePackage[final]{listings}
+\RequirePackage{longtable}
+\RequirePackage{rotating}
+\RequirePackage{setspace}
+\RequirePackage{theorem}
+\RequirePackage{titlesec}
+\RequirePackage[nottoc,notindex,section]{tocbibind}
+\RequirePackage{totcount}
+\RequirePackage{xcolor}
+\RequirePackage[a-1b]{pdfx}
+\RequirePackage[utf8]{inputenc}
+\DeclareOption{czech}
+{
+\setcounter{Dipl@CurrentThesisLanguage}{\Dipl@CzechLanguage}
+\Dipl@UniversityName={VŠB -- Technická univerzita Ostrava}
+\Dipl@FacultyName={Fakulta elektrotechniky a informatiky}
+}
+\DeclareOption{english}
+{
+\setcounter{Dipl@CurrentThesisLanguage}{\Dipl@EnglishLanguage}
+\Dipl@UniversityName={VŠB -- Technical University of Ostrava}
+\Dipl@FacultyName={Faculty of Electrical Engineering and Computer Science}
+}
+\DeclareOption{slovak}
+{
+\setcounter{Dipl@CurrentThesisLanguage}{\Dipl@SlovakLanguage}
+\Dipl@UniversityName={VŠB -- Technická univerzita Ostrava}
+\Dipl@FacultyName={Fakulta elektrotechniky a informatiky}
+}
+\DeclareOption{bachelor}
+{
+\setcounter{Dipl@CurrentThesisType}{\Dipl@BachelorThesis}
+\Dipl@CooperatingPersonsDeclaration={\Dipl@IfEnglish{I hereby agree to the publishing of the bachelor's thesis as per s. 26, ss. 9 of the Study and Examination Regulations for Bachelor's Degree Programmes at VŠB -- Technical University of Ostrava.}{Souhlasím se zveřejněním této bakalářské práce dle požadavků čl.\ 26, odst.\ 9 Studijního a~zkušebního řádu pro studium v bakalářských programech VŠB-TU Ostrava.}}
+}
+\DeclareOption{bachelorpractice}
+{
+\setcounter{Dipl@CurrentThesisType}{\Dipl@BachelorPractice}
+\Dipl@CzechThesisTitle={Absolvování individuální odborné praxe}
+\Dipl@EnglishThesisTitle={Individual Professional Practice in the Company}
+\Dipl@CooperatingPersonsDeclaration={\Dipl@IfEnglish{I hereby agree to the publishing of the bachelor's thesis as per s. 26, ss. 9 of the Study and Examination Regulations for Bachelor's Degree Programmes at VŠB -- Technical University of Ostrava.}{Souhlasím se zveřejněním této bakalářské práce dle požadavků čl.\ 26, odst.\ 9 Studijního a~zkušebního řádu pro studium v bakalářských programech VŠB-TU Ostrava.}}
+}
+\DeclareOption{master}
+{
+\setcounter{Dipl@CurrentThesisType}{\Dipl@MasterThesis}
+\Dipl@CooperatingPersonsDeclaration={\Dipl@IfEnglish{I hereby agree to the publishing of the master's thesis as per s. 26, ss. 9 of the Study and Examination Regulations for Master's Degree Programmes at VŠB -- Technical University of Ostrava.}{Souhlasím se zveřejněním této diplomové práce dle požadavků čl.\ 26, odst.\ 9 Studijního a~zkušebního řádu pro studium v magisterských programech VŠB-TU Ostrava.}}
+}
+\DeclareOption{phd}{\setcounter{Dipl@CurrentThesisType}{\Dipl@PhDThesis}}
+\DeclareOption{public}{\setboolean{Dipl@IsPublicPart}{true}}
+\DeclareOption{nonpublic}{\setboolean{Dipl@IsPublicPart}{false}}
+\DeclareOption{cpdeclaration}{\setboolean{Dipl@PrintCooperatingPersonsDeclaration}{true}}
+\DeclareOption{dept410}{\Dipl@DepartmentName={\Dipl@IfEnglish{Department of Electrical Power Engineering}{Katedra elektroenergetiky}}}
+\DeclareOption{dept420}{\Dipl@DepartmentName={\Dipl@IfEnglish{Department of Electrical Engineering}{Katedra elektrotechniky}}}
+\DeclareOption{dept430}{\Dipl@DepartmentName={\Dipl@IfEnglish{Department of Electronics}{Katedra elektroniky}}}
+\DeclareOption{dept440}{\Dipl@DepartmentName={\Dipl@IfEnglish{Department of Telecommunications}{Katedra telekomunikační techniky}}}
+\DeclareOption{dept450}{\Dipl@DepartmentName={\Dipl@IfEnglish{Department of Cybernetics and Biomedical Engineering}{Katedra kybernetiky a biomedicínského inženýrství}}}
+\DeclareOption{dept460}{\Dipl@DepartmentName={\Dipl@IfEnglish{Department of Computer Science}{Katedra informatiky}}}
+\DeclareOption{dept470}{\Dipl@DepartmentName={\Dipl@IfEnglish{Department of Applied Mathematics}{Katedra aplikované matematiky}}}
+\DeclareOption{male}
+{
+\setboolean{Dipl@AuthorIsMale}{true}
+\ifthenelse{\(\value{Dipl@CurrentThesisType}=\Dipl@BachelorThesis\) \or \(\value{Dipl@CurrentThesisType}=\Dipl@BachelorPractice\)}
+{
+\Dipl@AuthorDeclaration={\Dipl@IfEnglish{I hereby declare that this bachelor's thesis was written by myself. I have quoted all the references I have drawn upon.}{Prohlašuji, že jsem tuto bakalářskou práci vypracoval samostatně. Uvedl jsem všechny literární prameny a publikace, ze kterých jsem čerpal.}}
+}
+{\relax}
+\ifthenelse{\value{Dipl@CurrentThesisType}=\Dipl@MasterThesis}
+{
+
+\Dipl@AuthorDeclaration={\Dipl@IfEnglish{I hereby declare that this master's thesis was written by myself. I have quoted all the references I have drawn upon.}{Prohlašuji, že jsem tuto diplomovou práci vypracoval samostatně. Uvedl jsem všechny literární prameny a publikace, ze kterých jsem čerpal.}}
+}
+{\relax}
+}
+\DeclareOption{female}
+{
+\setboolean{Dipl@AuthorIsMale}{false}
+\ifthenelse{\(\value{Dipl@CurrentThesisType}=\Dipl@BachelorThesis\) \or \(\value{Dipl@CurrentThesisType}=\Dipl@BachelorPractice\)}
+{
+\Dipl@AuthorDeclaration={\Dipl@IfEnglish{I hereby declare that this bachelor's thesis was written by myself. I have quoted all the references I have drawn upon.}{Prohlašuji, že jsem tuto bakalářskou práci vypracovala samostatně. Uvedla jsem všechny literární prameny a publikace, ze kterých jsem čerpala.}}
+}
+{\relax}
+\ifthenelse{\value{Dipl@CurrentThesisType}=\Dipl@MasterThesis}
+{
+\Dipl@AuthorDeclaration={\Dipl@IfEnglish{I hereby declare that this master's thesis was written by myself. I have quoted all the references I have drawn upon.}{Prohlašuji, že jsem tuto diplomovou práci vypracovala samostatně. Uvedla jsem všechny literární prameny a publikace, ze kterých jsem čerpala.}}
+}
+{\relax}
+}
+\DeclareOption{ansic}{\Dipl@DefaultSourceCodeLanguage={ansic}}
+\DeclareOption{bash}{\Dipl@DefaultSourceCodeLanguage={bash}}
+\DeclareOption{cil}{\Dipl@DefaultSourceCodeLanguage={cil}}
+\DeclareOption{cpp}{\Dipl@DefaultSourceCodeLanguage={cpp}}
+\DeclareOption{csharp}{\Dipl@DefaultSourceCodeLanguage={csharp}}
+\DeclareOption{delphi}{\Dipl@DefaultSourceCodeLanguage={delphi}}
+\DeclareOption{gnuplot}{\Dipl@DefaultSourceCodeLanguage={gnuplot}}
+\DeclareOption{html}{\Dipl@DefaultSourceCodeLanguage={html}}
+\DeclareOption{java}{\Dipl@DefaultSourceCodeLanguage={java}}
+\DeclareOption{latex}{\Dipl@DefaultSourceCodeLanguage={latex}}
+\DeclareOption{lisp}{\Dipl@DefaultSourceCodeLanguage={lisp}}
+\DeclareOption{lua}{\Dipl@DefaultSourceCodeLanguage={lua}}
+\DeclareOption{make}{\Dipl@DefaultSourceCodeLanguage={make}}
+\DeclareOption{mathematica}{\Dipl@DefaultSourceCodeLanguage={mathematica}}
+\DeclareOption{matlab}{\Dipl@DefaultSourceCodeLanguage={matlab}}
+\DeclareOption{octave}{\Dipl@DefaultSourceCodeLanguage={octave}}
+\DeclareOption{pascal}{\Dipl@DefaultSourceCodeLanguage={pascal}}
+\DeclareOption{perl}{\Dipl@DefaultSourceCodeLanguage={perl}}
+\DeclareOption{php}{\Dipl@DefaultSourceCodeLanguage={php}}
+\DeclareOption{pov}{\Dipl@DefaultSourceCodeLanguage={pov}}
+\DeclareOption{prolog}{\Dipl@DefaultSourceCodeLanguage={prolog}}
+\DeclareOption{python}{\Dipl@DefaultSourceCodeLanguage={python}}
+\DeclareOption{ruby}{\Dipl@DefaultSourceCodeLanguage={ruby}}
+\DeclareOption{r}{\Dipl@DefaultSourceCodeLanguage={r}}
+\DeclareOption{sh}{\Dipl@DefaultSourceCodeLanguage={sh}}
+\DeclareOption{sql}{\Dipl@DefaultSourceCodeLanguage={sql}}
+\DeclareOption{tcltk}{\Dipl@DefaultSourceCodeLanguage={tcltk}}
+\DeclareOption{vb}{\Dipl@DefaultSourceCodeLanguage={vb}}
+\DeclareOption{vhdl}{\Dipl@DefaultSourceCodeLanguage={vhdl}}
+\DeclareOption{xml}{\Dipl@DefaultSourceCodeLanguage={xml}}
+\DeclareOption{xslt}{\Dipl@DefaultSourceCodeLanguage={xslt}}
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+\ProcessOptions
+\newcommand{\ThesisAuthor}[1]{\Dipl@ThesisAuthor={#1}}
+\newcommand{\CzechThesisTitle}[1]{\ifthenelse{\value{Dipl@CurrentThesisType}=\Dipl@BachelorPractice}{\relax}{\Dipl@CzechThesisTitle={#1}}}
+\newcommand{\EnglishThesisTitle}[1]{\ifthenelse{\value{Dipl@CurrentThesisType}=\Dipl@BachelorPractice}{\relax}{\Dipl@EnglishThesisTitle={#1}}}
+\newcommand{\SubmissionDate}[1]{\Dipl@SubmissionDate={#1}}
+\newcommand{\ThesisAssignmentImagePath}[1]{\Dipl@ThesisAssignmentImagePath={#1}}
+\newcommand{\AuthorDeclarationImageFile}[1]{\Dipl@AuthorDeclarationImageFile={#1}}
+\newcommand{\ThesisAccessRestriction}[1]{\Dipl@ThesisAccessRestriction={#1}}
+\newcommand{\CooperatingPersonsDeclarationImageFile}[1]{\Dipl@CooperatingPersonsDeclarationImageFile={#1}}
+\newcommand{\Thanks}[1]{\Dipl@Thanks={#1}}
+\newcommand{\CzechAbstract}[1]{\Dipl@CzechAbstract={#1}}
+\newcommand{\CzechKeywords}[1]{\Dipl@CzechKeywords={#1}}
+\newcommand{\EnglishAbstract}[1]{\Dipl@EnglishAbstract={#1}}
+\newcommand{\EnglishKeywords}[1]{\Dipl@EnglishKeywords={#1}}
+\newcommand{\AddAcronym}[2]{\Dipl@AddTokens{\Dipl@Acronyms}{#1&--&#2\\}}
+\newcommand{\MakeTitlePages}
+{
+\pagestyle{empty}
+\Dipl@TitlePage
+\Dipl@ThesisAssignmentPage
+\Dipl@AuthorDeclarationPage
+\Dipl@CooperatingPersonsDeclarationPage
+\Dipl@WriteThanksPage
+\Dipl@AbstractsKeywordsPage
+\pagestyle{plain}
+\tableofcontents\cleardoublepage
+\Dipl@WriteAcronymsPage
+\ifthenelse{\totvalue{figure}>0}{\listoffigures\cleardoublepage}{\relax}
+\ifthenelse{\totvalue{table}>0}{\listoftables\cleardoublepage}{\relax}
+}
+{\theorembodyfont{\itshape}\newtheorem{definition}{\Dipl@IfEnglish{Definition}{Definice}}}
+{\theorembodyfont{\itshape}\newtheorem{theorem}{\Dipl@IfEnglish{Theorem}{Věta}}}
+\newenvironment{proof}
+{\par\noindent\textbf{\proofname}}
+{\mbox{}\hspace*{5pt}\hfill\hbox{\vrule height5pt depth0pt width5pt}\par\medskip}
+{\theorembodyfont{\rmfamily}\newtheorem{remark}{\Dipl@IfEnglish{Remark}{Poznámka}}}
+{\theoremstyle{break}\theorembodyfont{\rmfamily}\newtheorem{Dipl@examplebody}{\Dipl@IfEnglish{Example}{Příklad}}}
+\newenvironment{example}
+{\begin{Dipl@examplebody}}
+{
+\nopagebreak\mbox{}\hspace*{5pt}\hfill\hbox{\vrule height5pt depth0pt width5pt}
+\end{Dipl@examplebody}
+}
+\newcommand{\InsertFigure}[4]
+{
+\begin{figure}
+\centering
+\includegraphics[width=#2]{#1}
+\caption{#3}
+\label{#4}
+\end{figure}
+}
+\newcommand{\Dipl@TitlePage}
+{
+\begin{center}
+\sffamily
+{\Large\the\Dipl@UniversityName\par
+\the\Dipl@FacultyName\par
+\the\Dipl@DepartmentName\par}
+\vspace{26mm}
+{\Huge\bfseries\Dipl@IfEnglish{\the\Dipl@EnglishThesisTitle}{\the\Dipl@CzechThesisTitle}\par}
+\bigskip
+{\Huge\bfseries\Dipl@IfEnglish{\the\Dipl@CzechThesisTitle}{\the\Dipl@EnglishThesisTitle}\par}
+\ifthenelse{\boolean{Dipl@IsPublicPart}}{\relax}
+{
+\bigskip
+\bigskip
+{\huge\Dipl@IfEnglish{Non-public part/Neveřejná část}{Neveřejná část/Non-public part}\par}
+}
+\end{center}
+\vfill
+{\sffamily\Large\number\year\hfill\the\Dipl@ThesisAuthor}
+\cleardoublepage
+}
+\newcommand{\Dipl@ThesisAssignmentPage}
+{
+\ifthenelse{\equal{\the\Dipl@ThesisAssignmentImagePath}{\empty}}
+{
+\begin{center}
+\Large\sffamily\bfseries
+\Dipl@IfEnglish{This page will be replaced by official thesis assignment in printed and electronic version of the submitted thesis.}%
+{Tuto stránku nahradíte v tištěné verzi práce oficiálním zadáním Vaší diplomové či bakalářské práce.}
+\end{center}
+}
+{
+\setcounter{Dipl@ThesisAssignmentImageCounter}{1}
+\whiledo{\value{Dipl@ThesisAssignmentImageCounter}>0}
+{
+\IfFileExists{\the\Dipl@ThesisAssignmentImagePath\theDipl@ThesisAssignmentImageCounter.jpg}
+{
+\Dipl@InsertFullPageImage{\the\Dipl@ThesisAssignmentImagePath\theDipl@ThesisAssignmentImageCounter.jpg}
+\addtocounter{Dipl@ThesisAssignmentImageCounter}{1}
+}
+{
+\setcounter{Dipl@ThesisAssignmentImageCounter}{-1}
+}
+}
+}
+\cleardoublepage
+}
+\newcommand{\Dipl@AuthorDeclarationPage}
+{
+\ifthenelse{\equal{\the\Dipl@AuthorDeclarationImageFile}{\empty}}
+{
+\mbox{}
+\vfill
+\noindent
+\the\Dipl@AuthorDeclaration
+\par
+\vspace{15mm}
+\noindent\Dipl@IfEnglish{Ostrava,}{V Ostravě}~\the\Dipl@SubmissionDate\hfill\hbox to50mm{\dotfill}
+}
+{
+\Dipl@InsertFullPageImage{\the\Dipl@AuthorDeclarationImageFile}
+}
+\cleardoublepage
+}
+\newcommand{\Dipl@CooperatingPersonsDeclarationPage}
+{
+\ifthenelse{\boolean{Dipl@PrintCooperatingPersonsDeclaration}}
+{
+\ifthenelse{\equal{\the\Dipl@CooperatingPersonsDeclarationImageFile}{\empty}}
+{
+\mbox{}
+\vfill
+\ifthenelse{\equal{\the\Dipl@ThesisAccessRestriction}{\empty}}
+{\relax}
+{\noindent\the\Dipl@ThesisAccessRestriction\par\bigskip}
+\noindent
+\the\Dipl@CooperatingPersonsDeclaration
+\par
+\vspace{15mm}
+\noindent\Dipl@IfEnglish{Ostrava,}{V Ostravě}~\the\Dipl@SubmissionDate\hfill\hbox to50mm{\dotfill}
+}
+{
+\Dipl@InsertFullPageImage{\the\Dipl@CooperatingPersonsDeclarationImageFile}
+}
+\cleardoublepage
+}
+{\relax}
+}
+\newcommand{\Dipl@WriteThanksPage}
+{
+\ifthenelse{\equal{\the\Dipl@Thanks}{\empty}}
+{\relax}
+{
+\mbox{}
+\vfill
+\noindent\the\Dipl@Thanks
+\cleardoublepage
+}
+}
+\newcommand{\Dipl@AbstractsKeywordsPage}
+{
+\vspace*{20mm plus 0mm minus 25mm}
+\ifthenelse{\value{Dipl@CurrentThesisLanguage}=\Dipl@SlovakLanguage}
+{
+\begin{otherlanguage}{slovak}
+\noindent\textbf{Abstrakt}
+\medbreak
+\noindent\the\Dipl@CzechAbstract
+\bigbreak
+\noindent\textbf{Kľúčové slová}:~\the\Dipl@CzechKeywords\par
+ \end{otherlanguage}
+}
+{
+\begin{otherlanguage}{czech}
+\noindent\textbf{Abstrakt}
+\medbreak
+\noindent\the\Dipl@CzechAbstract
+\bigbreak
+\noindent\textbf{Klíčová slova}:~\the\Dipl@CzechKeywords\par
+
+\end{otherlanguage}
+}
+\vspace{30mm plus 0mm minus 30mm}
+\begin{otherlanguage}{english}
+\noindent\textbf{Abstract}
+\medbreak
+\noindent\the\Dipl@EnglishAbstract
+\bigbreak
+\noindent\textbf{Key Words}:~\the\Dipl@EnglishKeywords\par
+\end{otherlanguage}
+\cleardoublepage
+}
+\newcommand{\Dipl@WriteAcronymsPage}
+{
+\ifthenelse{\equal{\the\Dipl@Acronyms}{\empty}}
+{\relax}
+{
+\section*{\Dipl@IfEnglish{List of symbols and abbreviations}{Seznam použitých zkratek a symbolů}}
+\ifthenelse{\value{Dipl@CurrentThesisLanguage}=\Dipl@EnglishLanguage}
+{
+\addcontentsline{toc}{section}{List of symbols and abbreviations}
+}
+{
+\addcontentsline{toc}{section}{Seznam použitých zkratek a symbolů}
+}
+\begin{longtable*}[l]{p{0.2\textwidth}cp{0.7\textwidth}}
+\the\Dipl@Acronyms
+\end{longtable*}
+\cleardoublepage
+}
+}
+\newcommand{\Dipl@PrintRestriction}
+{
+\noindent\the\Dipl@PublicationAgreement\par
+\ifthenelse{\equal{\the\Dipl@AccessRestriction}{\empty}}
+{\relax}
+{\bigskip\noindent\the\Dipl@AccessRestriction\par}
+\vspace{15mm}
+\noindent\Dipl@IfEnglish{Ostrava,}{V Ostravě}~\the\Dipl@SubmissionDate\hfill\hbox to50mm{\dotfill}\par
+\vspace{15mm}
+}
+\newcommand{\sectionbreak}
+{
+\cleardoublepage
+\ifthenelse{\boolean{Dipl@IsAppendix}}{\relax}{\suppressfloats}
+}
+\let\Dipl@OldAppendix\appendix
+\renewcommand{\appendix}
+{
+\Dipl@OldAppendix
+\addcontentsline{toc}{section}{\appendixname}%
+}
+\newcommand{\Dipl@IfEnglish}[2]{\ifthenelse{\value{Dipl@CurrentThesisLanguage}=\Dipl@EnglishLanguage}{#1}{#2}}
+\newcommand{\Dipl@AddTokens}[2]{\expandafter \global#1\expandafter{\the#1#2}}
+\newcommand{\Dipl@InsertFullPageImage}[1]
+{
+\newgeometry{margin=1pt,nohead,nofoot,nomarginpar,centering}
+\thispagestyle{empty}
+\begin{center}
+\includegraphics[width=0.99\textwidth,height=0.99\textheight]{#1}
+\end{center}
+\cleardoublepage
+\restoregeometry
+}
+\newcommand{\Dipl@SetDefaultLanguage}
+{
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{ansic}}{\lstset{language=[ANSI]C}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{bash}}{\lstset{language=bash}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{cil}}{\lstset{language=CIL}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{cpp}}{\lstset{language=C++}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{csharp}}{\lstset{language=[Sharp]C}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{delphi}}{\lstset{language=Delphi}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{gnuplot}}{\lstset{language=Gnuplot}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{html}}{\lstset{language=HTML}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{java}}{\lstset{language=Java}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{latex}}{\lstset{language=[LaTeX]TeX}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{lisp}}{\lstset{language=Lisp}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{lua}}{\lstset{language=Lua}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{make}}{\lstset{language=make}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{mathematica}}{\lstset{language=Mathematica}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{matlab}}{\lstset{language=Matlab}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{octave}}{\lstset{language=Octave}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{pascal}}{\lstset{language=Pascal}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{perl}}{\lstset{language=Perl}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{php}}{\lstset{language=PHP}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{pov}}{\lstset{language=POV}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{prolog}}{\lstset{language=Prolog}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{python}}{\lstset{language=Python}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{ruby}}{\lstset{language=Ruby}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{r}}{\lstset{language=R}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{sh}}{\lstset{language=sh}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{sql}}{\lstset{language=SQL}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{tcltk}}{\lstset{language=[tk]tcl}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{vb}}{\lstset{language=[Visual]Basic}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{vhdl}}{\lstset{language=VHDL}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{xml}}{\lstset{language=XML}}{}
+\ifthenelse{\equal{\the\Dipl@DefaultSourceCodeLanguage}{xslt}}{\lstset{language=XSLT}}{}
+}
+\lstset
+{
+breaklines=true,
+tabsize=3,
+columns=flexible,
+showstringspaces=false,
+basicstyle=\ttfamily,
+keywordstyle=\color{blue},
+identifierstyle=\color[RGB]{43,145,175},
+commentstyle=\slshape\color[RGB]{0,128,0},
+stringstyle=\color[RGB]{163,21,21},
+frame=lines,
+captionpos=b,
+inputencoding=utf8,
+extendedchars=true,
+literate={á}{{\'{a}}}1 {Á}{{\'{A}}}1 {ä}{{\"{a}}}1 {Ä}{{\"{A}}}1 {č}{{\v{c}}}1 {Č}{{\v{C}}}1 {ď}{{\v{d}}}1 {Ď}{{\v{D}}}1 {ě}{{\v{e}}}1 {Ě}{{\v{E}}}1 {é}{{\'{e}}}1 {É}{{\'{E}}}1 {í}{{\'{i}}}1 {Í}{{\'{I}}}1 {ĺ}{{\'{l}}}1 {Ĺ}{{\'{L}}}1 {ľ}{{\v{l}}}1 {Ľ}{{\v{L}}}1 {ň}{{\v{n}}}1 {Ň}{{\v{N}}}1 {ó}{{\'{o}}}1 {Ó}{{\'{O}}}1 {ô}{{\^{o}}}1 {Ô}{{\^{O}}}1 {ř}{{\v{r}}}1 {Ř}{{\v{R}}}1 {ŕ}{{\'{r}}}1 {Ŕ}{{\'{R}}}1 {š}{{\v{s}}}1 {Š}{{\v{S}}}1 {ť}{{\v{t}}}1 {Ť}{{\v{T}}}1 {ú}{{\'{u}}}1 {Ú}{{\'{U}}}1 {ů}{{\r{u}}}1 {Ů}{{\r{U}}}1 {ý}{{\'{y}}}1 {Ý}{{\'{Y}}}1 {ž}{{\v{z}}}1 {Ž}{{\v{Z}}}1
+}
+\onehalfspacing
+\setcounter{tocdepth}{2}
+\setcounter{secnumdepth}{5}
+\widowpenalty=9000
+\clubpenalty=9000
+\regtotcounter{figure}
+\regtotcounter{table}
+\addto{\captionsczech}{\renewcommand{\refname}{Literatura}}
+\addto{\captionsslovak}{\renewcommand{\refname}{Literatura}}
+\addto{\captionsczech}{\renewcommand{\appendixname}{Přílohy}}
+\addto{\captionsslovak}{\renewcommand{\appendixname}{Přílohy}}
+\AtBeginDocument%
+{
+\ifthenelse{\value{Dipl@CurrentThesisLanguage}=\Dipl@CzechLanguage}
+{
+\selectlanguage{czech}
+\def\lstlistlistingname{Seznam výpisů zdrojového kódu}
+\def\lstlistingname{Výpis}
+}{}
+\ifthenelse{\value{Dipl@CurrentThesisLanguage}=\Dipl@EnglishLanguage}
+{
+\selectlanguage{english}
+}{}
+\ifthenelse{\value{Dipl@CurrentThesisLanguage}=\Dipl@SlovakLanguage}
+{
+\selectlanguage{slovak}
+\def\lstlistlistingname{Seznam výpisů zdrojového kódu}
+\def\lstlistingname{Výpis}
+}{}
+\renewcommand{\lstlistoflistings}{\begingroup\tocfile{\lstlistlistingname}{lol}\endgroup}
+\Dipl@SetDefaultLanguage
+}
+\endinput
+%%
+%% End of file `diploma.cls'.
diff --git a/document/document.pdf b/document/document.pdf
index fec06ac9286050605a45958fa734770d1d3d4681..fa40272e92744076009ca53aa05af392ef2cd18f 100644
Binary files a/document/document.pdf and b/document/document.pdf differ
diff --git a/document/document.tex b/document/document.tex
index fa2ce9b8b98c6e55d25d1ab1e8f0b4f535863d7d..9bb5d94d2c3977f5dc7197758c438bbabd153ec3 100644
--- a/document/document.tex
+++ b/document/document.tex
@@ -15,7 +15,9 @@
 %\usepackage{titlesec}
 %\newcommand{\sectionbreak}{\clearpage}
 %\setlist{nosep}
-\newcommand{\image}[3]{\begin{figure}[h!] \centering \includegraphics[width=#3\linewidth]{#1} \caption{#2} \end{figure}}
+
+\newcommand{\image}[4]{\begin{figure}[h!] \centering \includegraphics[width=#1\linewidth]{figures/#2} \label{#3} \caption{#4} \end{figure}}
+\newcommand{\bThreed}{B$^3$D}
 
 \author{Moravec Vojtěch}
 \title{Semestrální projekt}
@@ -27,7 +29,7 @@
 
 \section{ZISRAW (CZI) formát}
 
-Vše co bude v této sekci uvedeno vychýzí z oficiální specifikace formátu CZI. \ref{czi_spec}.
+Vše co bude v této sekci uvedeno vychýzí z oficiální specifikace formátu CZI. \cite{czi_spec}.
 
 Formát CZI je určen pro uložení obrazků, samotné schéma uložení dat ale vychází z formátu ZISRAW, který je určen pro různé typy souborů. 
 Hlavním cílem formátu ZISRAW je umožnit streamování dat a metadat v binární podobě (metadata jsou buď binární nebo v XML). \textit{CZI formát je aktuálně jedinou implementací ZISRAW.}
@@ -108,6 +110,27 @@ LZW je bezztrátová komprese, aktuálně se nepoužívá ve \say{widefield} mik
 může být použita pouze pro 2D obrazy. 
 Jpeg-XR podporuje jak ztrátovou tak i bezztrátovou kompresi. Vychází z JPEG a nabízí menší velikost pro stejnou kvalitu obrazu, ale stejně jako JPEG, je omezen na 2D obrazy.
 
-\bibliography{citations}
+\section{Kompresní knihovna \bThreed}
+\bThreed je Open Source knihovna, řešící problém komprese obrazů z mikroskopu. Je napsána v jazyce C++ a využívá CUDA  architektury. 
+Slibovaná rychlost komprese je více než 1 GB/s \cite{Balazs164624}. Tato knihovna nabízí jak ztrátovou tak i bezztrátovou kompres, kde ztrátová zohledňuje fakt,
+že se jedná o obrazy z mikroskopu a uživatel si může zvolit maximální chybu, kterou bude tolerovat. Definuji takzvaný WNL (\emph{within noise level}) mód 
+ztrátové komprese, kde kvantizační krok je roven šumu v obraze. V tomto módu je chyba vzniklá ztrátovou kompresí mnohem menší, než šum nacházející se v obraze.
+Kompresní poměry bezztrátové a WNL komprese můžeme vídět na Obrázku \ref{img:compressionComp}.
+
+\image{0.65}{compressionComparsionBars.pdf}{img:compressionComp}{Porovnání kompresních poměrů různých vzorků}
+
+Vliv ztrátové komprese na obraz byl testován na datasetu ebrya octomilky obecné, metodou segmentačního překrývání. Testovalo se vzhledem k originálnímu
+obrazu, a hodnota 1 znamená, že se obrazy dokonale překrývají. Na Obrázku \ref{img:segoverlap}, můžeme, že překryv klesá až při velkých komrpesních poměrech. 
+Překryv pro WNL je téměř dokonalý 0,996.
+
+\image{0.65}{noise_overlap.pdf}{img:segoverlap}{Vliv ztrátové komprese na kvalitu obrazu}
+
+Použitý bezztrátový algoritmus se skládá ze dvou částí. V první části se provede predikce hodnoty pixelu vzhledem k hodnotám jeho sousedů a v 
+druhé části jsou chyby predikce zakódovány pomocí RLE a Huffmana. Bezztrátová komprese dosáhla kompresního poměru 2,7 a pokud je použita WNL komprese
+dostáváme se až na kompresní poměr 5, a chyba lokalizace jediné molekuly v obrazu vstoupla pouze o 4\%. (Bylo testováno na datasetu získaném pomocí
+Single-Molecule Localization Microscopy, rozlišení 2-25 nm).
+
+% \bibliography{citations}
+% \bibliographystyle{ieeetr}
 
 \end{document}
\ No newline at end of file
diff --git a/document/figures/compressionComparsionBars.pdf b/document/figures/compressionComparsionBars.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..86aa535561d598ab99147459be3f59fc53677872
Binary files /dev/null and b/document/figures/compressionComparsionBars.pdf differ
diff --git a/document/figures/noise_overlap.pdf b/document/figures/noise_overlap.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ce6fd0f55f0f3a28f7b176ba01c474ded4338e2c
Binary files /dev/null and b/document/figures/noise_overlap.pdf differ