Search:
Menu OPAL / TriciaAmira

OPAL Home About People International Collaborators


sidehead OldTop sidehead OPAL Home-old sidehead About-old sidehead People-old


Activities


sidehead Activities-old * Imaging & Modeling * Fast Fluid Flow * Inverse Modeling * OSA * Mastication and Swallowing * Dysphagia ---- Publications


Opportunities


sidehead Opportunities-old * Post-doc & RA * Graduate Students * Undergrads


Events

sidehead Events? * PMHA 2013-old * PMHA 2014-old


How to contribute Contact us


Related Links

* Swallowing


Website problems?


Internal documents

edit SideBar

Using Amira (v 4.1.1)


Creating a Mesh from LW Output

In Amira

  1. Open Data...
  2. filename.hdr
    • Display -> Isosurface [Apply]
    • Compute -> SurfaceGen [Apply]
  3. filename.surf
    • Display -> SurfaceView
    • Simplifier: 1000 faces [Simply Now]
    • Compute -> SmoothSurface: 5 iterations, 0.6 lambda [Apply]
  4. filename.smooth
    • Display -> SurfaceView
    • Compute -> VRML-Export [Apply]

In command line, run "perl wrl2obj.pl filename"

wrl2obj.pl:

	#!/usr/bin/perl

	$filename = pop(@ARGV);

	$in = $filename.'.wrl';
	$out = '>'.$filename.'.obj';
	open (INFILE, $in) || die "Can't open '$in': $!\n";
	open (OUTFILE, $out);

	$readpoint = 0;
	$readface = 0;
	while (<INFILE>) {
		$line = $_;
		if ($readpoint == 1) {
			if ($line =~ m/}/) {
				$readpoint = 0;
			}
			elsif ($line =~ m/^[\d\s\-\.\,\]]+$/) {
				$line =~ s/^\s+//;
				$line =~ s/(\]|,)$//;
				if ($line !~ m/^$/) {
					print OUTFILE "v "."$line";
				}
			}
		}
		elsif ($readvertex == 1) {
			if ($line =~ m/}/) {
				$readvertex = 0;
			}
			elsif ($line =~ /(\d+), (\d+), (\d+), -1, (\d+), (\d+), (\d+), -1/) {
				print OUTFILE "f ".($1+1)." ".($2+1)." ".($3+1)."\n";
				print OUTFILE "f ".($4+1)." ".($5+1)." ".($6+1)."\n";
			}
		}
		elsif ($line =~ m/\s*point\s*\[/) {
			$readpoint = 1;
		}
		elsif ($line =~ m/\s*coordIndex\s*\[/) {
			$readvertex = 1;
		}
	}

	close(OUTFILE);
	close(INFILE);