Skip to content
Snippets Groups Projects
Commit c2e1aaa5 authored by Henrik Mäkinen's avatar Henrik Mäkinen
Browse files

Updated README. Added saving of input arguments to text file.

parent 10416941
Branches
No related tags found
No related merge requests found
......@@ -45,22 +45,22 @@ The output projections are HDF5 (.h5) files (864x864 px float64) with datasets f
Create processed projections as in sample data folder `Figure_5/Figure_5ad/processed` from the raw data in `Figure_5/raw` using each of the 361 sample and reference projections, and all 10 phase steps.
```
extract_images_tomoseries('/path_to_sample_data/Figure_5/raw/','pork%04d',[1:361],'ref%04d',[1:361],[1:1:10],'/path_to_sample_data/Figure_5/Figure_5ad/processed_2','im','clamp2pi',[0,0,0,0,0,1,1,0,0]);
extract_images_tomoseries('/path_to_sample_data/Figure_5/raw/','pork%04d','[1:361]','ref%04d','[1:361]','[1:1:10]','/path_to_sample_data/Figure_5/Figure_5ad/processed_2','im','clamp2pi','[0,0,0,0,0,1,1,0,0]');
```
# Input parameters
# Input parameters (as strings)
- **datapath**
Absolute path to folder containing the raw image data
- **prefix_template**
Template for the prefix of a single piezo stepping scan (e.g. 'sample%04d' will give sample0001, sample0002, etc.; make sure this matches the actual names of the raw images
- **tomoind**
List of image numbers for the tomo series; specify a range or single projection (e.g. [1:361] or [165]); other than full ranges or a single image might not work currently!
List of image numbers for the tomo series; specify a range or single projection (e.g. '[1:361]' or '[165]'); other than full ranges or a single image might not work currently!
- **ref_prefix_template**
Template for the prefix of the reference scans (e.g. 'ref%04d')
- **ref_tomoind**
List of image numbers for reference images (see 'tomoind'); partial ranges can be used with restrictions (e.g. must be at even intervals)
- **step_template**
E.g. [1:1:10] for 10 consecutive phase-step images; can be used to choose only part of phase-steps
E.g. '[1:1:10]' for 10 consecutive phase-step images; can be used to choose only part of phase-steps
- **outpath**
Folder where output data will be saved
- **outprefix**
......@@ -97,7 +97,10 @@ extract_images_tomoseries('/path_to_sample_data/Figure_5/raw/','pork%04d',[1:361
E.g., for templates 'im%04d' and 'ref%04d': 'im0001_01.smv' and 'ref0001_01.smv', where the 1st number is the tomo angle, and the 2nd the phase-step. While the prefix can be specified here, the part after that is fixed in the code.
# Sample data
(TODO: Add link to sample data including params.txt and scan.csv)
Raw .smv files, processed projections and reconstructed data is available at:
```
https://doi.org/10.23729/60132ae3-1ce3-41eb-935f-d0721ad464aa
```
# TODO
- Improve image import and creation time
......
......@@ -32,7 +32,6 @@
%
% NAMING OF RAW IMAGE FILES
% e.g. 'im0001_01.smv' and 'ref0001_01.smv'; 1st number is tomo angle, 2nd phase step
%
function extract_images_tomoseries(datapath,prefix_template,tomoind,ref_prefix_template,ref_tomoind,step_template,outpath,outprefix,unwrapopt,options)
......@@ -40,6 +39,16 @@ function extract_images_tomoseries(datapath,prefix_template,tomoind,ref_prefix_t
%%% PREPARATIONS %%%
%%%%%%%%%%%%%%%%%%%%
% Write given arguments to file (for later reference)
fn = fullfile(outpath,'arguments.txt');
save_input_args(fn,datapath,prefix_template,tomoind,ref_prefix_template,ref_tomoind,step_template,outpath,outprefix,unwrapopt,options);
% Evaluate given expressions
tomoind = eval(tomoind);
ref_tomoind = eval(ref_tomoind);
step_template = eval(step_template);
options = eval(options);
% Parameter file name
paramsfname = 'params.txt';
......
......@@ -41,7 +41,7 @@ function params = get_image_params(paramsfilename)
params.y_start = 1; %Start location (y, in initial image)
params.y_end = 864; %End location (y, in initial image)
yw = params.y_end-params.y_start;
params.xpoints_bg = unique([10:10:200 xw-200:10:xw-10 xw-10]);
params.xpoints_bg = unique([10:10:150 xw-150:10:xw-10 xw-10]);
params.ypoints_bg = unique([10:10:yw-10 yw-10]);
params.rotate = 180; %Specify in degrees how the images should be rotated
......
function save_input_args(fname,varargin)
writecell(varargin',fname);
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment