readMri3d: Read MATLAB-Format data from mri3d.exe

Description Usage Arguments Value Examples

Description

The MATLAB program mri3d.exe is used for MRI segmentation at the University Hospital of Zuerich. With File/Save/Measurements, a MATLAB file (default extension .mat) with segmentation slices and 3D-mesh data can be exported and imported into R by function readMri3d. The sampling of slices can be optionally decimated.

Usage

1
readMri3d(filename, dmin = NULL)

Arguments

filename

Name of file exported with from mri3d.exe

dmin

Smallest permissible length of an edge. Used in function simplify.owin in package spatstat. No reduction when dmin==NULL.

Value

List with the following items: vars: parameter settings used for mri3d.exe, and record data: examination date, protocol name, examination name, filename, directory; and from 3D analysis: vol3d (Volume) and area3d (surface area).

slices: data frame with slice number, segment number, x and y

slicearea: data frame with slice, segment and area

indices: 3D integer array of indices of hull triangles; can be NULL

vertices: 3D numeric array of vertex positions; can be NULL

Examples

 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
filename = system.file("extdata", "rec1.mat", package = "Dmri3d")
mri = readMri3d(filename)
str(mri)
## Not run: 
library(rgl)
open3d()
wire3d(with(mri,tmesh3d(vertices[[1]], indices[[1]], homogeneous=FALSE)))
wire3d(with(mri,tmesh3d(vertices[[2]], indices[[2]], homogeneous=FALSE)))
wire3d(with(mri,tmesh3d(vertices[[3]], indices[[3]], homogeneous=FALSE)))
library(Rvcg)
plotSimplified = function(mri,index){
  open3d()
  mesh3d = list(vb=rbind(mri$vertices[[index]],
                         rep(1,ncol(mri$vertices[[index]]))),
                it=mri$indices[[index]])
  class(mesh3d) = "mesh3d"
  mesh3dA = vcgQEdecim(mesh3d, percent = 0.1, normcheck = TRUE)
  mesh3dB = vcgSmooth(mesh3d, iteration=1)
  wire3d(mesh3dA)
}
plotSimplified(mri,1)
plotSimplified(mri,2)
plotSimplified(mri,3)

## End(Not run)

dmenne/dmri3d documentation built on May 15, 2019, 9:32 a.m.