|
63 | 63 | % 'vector', 'none'. Default value is assessed from data type and |
64 | 64 | % size. |
65 | 65 | % |
| 66 | +% * 'parent' another instance of Slicer, that is used to initialize |
| 67 | +% several parameters like spatial resolution, display range, LUT |
| 68 | +% for display... |
| 69 | +% |
| 70 | +% |
66 | 71 | % Example |
67 | 72 | % % Explore human brain MRI |
68 | 73 | % metadata = analyze75info('brainMRI.hdr'); |
|
87 | 92 |
|
88 | 93 | %% Properties |
89 | 94 | properties |
90 | | - % reference image (can be 2D, 3D or 4D) |
| 95 | + % Image data stored as a 3D or 4D array, in YX(C)Z order. |
91 | 96 | imageData; |
92 | 97 |
|
93 | 98 | % type of image. Can be one of: |
|
185 | 190 | % parses input arguments |
186 | 191 | parsesInputArguments(); |
187 | 192 |
|
| 193 | + % add checkup on visible image slice |
| 194 | + this.sliceIndex = min(this.sliceIndex, this.imageSize(3)); |
| 195 | + |
188 | 196 | updateCalibrationFlag(this); |
189 | 197 |
|
190 | 198 | % create default figure |
@@ -224,6 +232,20 @@ function parsesInputArguments() |
224 | 232 | while length(varargin) > 1 |
225 | 233 | param = varargin{1}; |
226 | 234 | switch lower(param) |
| 235 | + case 'parent' |
| 236 | + % copy some settings from parent Slicer |
| 237 | + parent = varargin{2}; |
| 238 | + this.sliceIndex = parent.sliceIndex; |
| 239 | + this.voxelSize = parent.voxelSize; |
| 240 | + this.voxelOrigin = parent.voxelOrigin; |
| 241 | + this.voxelSizeUnit = parent.voxelSizeUnit; |
| 242 | + this.calibrated = parent.calibrated; |
| 243 | + this.imageType = parent.imageType; |
| 244 | + this.displayRange = parent.displayRange; |
| 245 | + this.colorMap = parent.colorMap; |
| 246 | + this.bgColor = parent.bgColor; |
| 247 | + this.calibrated = parent.calibrated; |
| 248 | + |
227 | 249 | case 'slice' |
228 | 250 | % setup initial slice |
229 | 251 | pos = varargin{2}; |
|
0 commit comments