partition
Description
Examples
Create a blocked image.
bim = blockedImage('tumor_091R.tif');Create a blocked image datastore from the blocked image.
bimds = blockedImageDatastore(bim);
Partition the blocked image datastore into two partitions and create a new blockedImageDatastore object of the data in the first partition.
bimdsp1 = partition(bimds, 2, 1);
Read data from the first partition.
disp('Partition 1');Partition 1
while hasdata(bimdsp1) [data, info] = read(bimdsp1); disp(info); end
BlockSub: [1 1 1]
Start: [1 1 1]
End: [1024 1024 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [1 2 1]
Start: [1 1025 1]
End: [1024 2048 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [1 3 1]
Start: [1 2049 1]
End: [1024 3072 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [1 4 1]
Start: [1 3073 1]
End: [1024 4096 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [1 5 1]
Start: [1 4097 1]
End: [1024 5120 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [1 6 1]
Start: [1 5121 1]
End: [1024 6144 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [2 1 1]
Start: [1025 1 1]
End: [2048 1024 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [2 2 1]
Start: [1025 1025 1]
End: [2048 2048 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [2 3 1]
Start: [1025 2049 1]
End: [2048 3072 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [2 4 1]
Start: [1025 3073 1]
End: [2048 4096 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [2 5 1]
Start: [1025 4097 1]
End: [2048 5120 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [2 6 1]
Start: [1025 5121 1]
End: [2048 6144 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [3 1 1]
Start: [2049 1 1]
End: [3072 1024 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [3 2 1]
Start: [2049 1025 1]
End: [3072 2048 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [3 3 1]
Start: [2049 2049 1]
End: [3072 3072 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
Partition the blocked image datastore and create a new blockedImageDatastore object of the data in the second partition.
bimdsp2 = partition(bimds, 2, 2);
Read data from the second partition.
disp('Partition 2');Partition 2
while hasdata(bimdsp2) [data, info] = read(bimdsp2); disp(info); end
BlockSub: [3 4 1]
Start: [2049 3073 1]
End: [3072 4096 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [3 5 1]
Start: [2049 4097 1]
End: [3072 5120 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [3 6 1]
Start: [2049 5121 1]
End: [3072 6144 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [4 1 1]
Start: [3073 1 1]
End: [4096 1024 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [4 2 1]
Start: [3073 1025 1]
End: [4096 2048 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [4 3 1]
Start: [3073 2049 1]
End: [4096 3072 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [4 4 1]
Start: [3073 3073 1]
End: [4096 4096 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [4 5 1]
Start: [3073 4097 1]
End: [4096 5120 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [4 6 1]
Start: [3073 5121 1]
End: [4096 6144 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [5 1 1]
Start: [4097 1 1]
End: [5120 1024 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [5 2 1]
Start: [4097 1025 1]
End: [5120 2048 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [5 3 1]
Start: [4097 2049 1]
End: [5120 3072 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [5 4 1]
Start: [4097 3073 1]
End: [5120 4096 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [5 5 1]
Start: [4097 4097 1]
End: [5120 5120 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
BlockSub: [5 6 1]
Start: [4097 5121 1]
End: [5120 6144 3]
Level: 1
ImageNumber: 1
BorderSize: [0 0 0]
BlockSize: [1024 1024 3]
Input Arguments
Blocked image datastore, specified as a blockedImageDatastore object.
Number of partitions, specified as a numeric scalar. To get an estimate for a
reasonable value for N, use the numpartitions
function.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Partition to read, specified as a numeric scalar.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical
Output Arguments
Subset of datastore, returned as a blockedImageDatastore object.
Version History
Introduced in R2021a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)