-
Notifications
You must be signed in to change notification settings - Fork 1
/
setDataset_chunks_ByVector.m
39 lines (35 loc) · 1.24 KB
/
setDataset_chunks_ByVector.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
% Set the chunks of a dataset by a given vector.
%
% Author: Maurice Hollmann
% Date : 0/910
%
% Description:
%
% [dataset] = setDataset_chunks_ByVector(dataset, chunkVector)
%
% This methods sets the chunks of the given dataset. Chunks can be used to
% subdivide a dataset. One may for example set a separate chunk for all transition
% scans for easy removing after preprocessing.
%
% Parameters:
% dataset - the datset to set the data4D for
% chunkVector - a vector holing chunk information
%
% Returns:
% dataset - the datset with included chunks
%
% Comments:
%
function [dataset] = setDataset_chunks_ByVector(dataset, chunkVector)
if( ~exist('dataset','var') || ~exist('chunkVector','var') )
error('Usage of setDataset_chunks_ByVector: [dataset] = setDataset_chunks_ByAttribFile(dataset, chunkVector [1xN vector])');
end
if(size(chunkVector,2) == 1 && size(chunkVector,1) > size(chunkVector,2))
dataset.chunks = uint16(chunkVector');
else
dataset.chunks = uint16(chunkVector);
end
if(~checkDataset(dataset))
disp('WARNING: setDataset_chunks_ByVector: In the current state the dataset is not suitable for further processing, please see messages before!');
end
end