Tree @debian/1.9.6+ds-1 (Download .tar.gz)
- .git_filters
- debian
- doc
- meshfix
- sample
- tools
- .gitattributes
- .gitignore
- .gitmodules
- advancefront.m
- affinemap.m
- AUTHORS.txt
- barydualmesh.m
- base64decode.m
- base64encode.m
- bbxflatsegment.m
- binsurface.m
- bwislands.m
- cgals2m.m
- cgalv2m.m
- ChangeLog.txt
- closestnode.m
- Content.txt
- COPYING.txt
- decodevarname.m
- deislands2d.m
- deislands3d.m
- delendelem.m
- deletemeshfile.m
- DESCRIPTION
- dist2surf.m
- edgeneighbors.m
- elemfacecenter.m
- elemvolume.m
- encodevarname.m
- extractloops.m
- extrudecurve.m
- extrudesurf.m
- faceneighbors.m
- fallbackexeext.m
- fast_match_bracket.m
- fillholes3d.m
- fillsurf.m
- finddisconnsurf.m
- flatsegment.m
- gendocs.sh
- getexeext.m
- getintersecttri.m
- getoptkey.m
- getplanefrom3pt.m
- getvarfrom.m
- gzipdecode.m
- gzipencode.m
- highordertet.m
- i2m.m
- i2m.png
- i2m.prj
- imedge3d.m
- img2mesh.fig
- img2mesh.m
- INDEX
- innersurf.m
- insurface.m
- internalpoint.m
- iso2meshver.m
- isoctavemesh.m
- jdatadecode.m
- jdataencode.m
- jload.m
- jnifticreate.m
- jnii2nii.m
- jsave.m
- jsonopt.m
- latticegrid.m
- layersurf.m
- linextriangle.m
- loadbj.m
- loadjnifti.m
- loadjson.m
- loadmsgpack.m
- loadnifti.m
- loadubjson.m
- lz4decode.m
- lz4encode.m
- lz4hcdecode.m
- lz4hcencode.m
- lzipdecode.m
- lzipencode.m
- lzmadecode.m
- lzmaencode.m
- m2v.m
- maskdist.m
- match_bracket.m
- maxsurf.m
- mcpath.m
- memmapstream.m
- mergemesh.m
- mergestruct.m
- mergesurf.m
- mesh2mask.m
- mesh2vol.m
- meshabox.m
- meshacylinder.m
- meshanellip.m
- meshasphere.m
- meshcentroid.m
- meshcheckrepair.m
- meshconn.m
- meshcylinders.m
- meshedge.m
- mesheuler.m
- meshface.m
- meshgrid5.m
- meshgrid6.m
- meshinterp.m
- meshquality.m
- meshrefine.m
- meshremap.m
- meshreorient.m
- meshresample.m
- meshunitsphere.m
- metchgui.fig
- metchgui.m
- metchgui_one.m
- mwpath.m
- ndgaussian.m
- ndimfilter.m
- neighborelem.m
- nestbracket2dim.m
- nifticreate.m
- nii2jnii.m
- niicodemap.m
- niiformat.m
- nodesurfnorm.m
- nodevolume.m
- orderloopedge.m
- orthdisk.m
- outersurf.m
- plotedges.m
- plotmesh.m
- plotsurf.m
- plottetra.m
- polylineinterp.m
- polylinelen.m
- polylinesimplify.m
- proj2mesh.m
- qmeshcut.m
- raysurf.m
- raytrace.m
- readasc.m
- readgts.m
- readinr.m
- README.md
- README.txt
- readmedit.m
- readmptiff.m
- readnifti.m
- readnirfast.m
- readoff.m
- readsmf.m
- readtetgen.m
- regpt2surf.m
- remeshsurf.m
- removedupelem.m
- removedupnodes.m
- removeisolatednode.m
- removeisolatedsurf.m
- rotatevec3d.m
- rotmat2vec.m
- s2m.m
- s2v.m
- saveabaqus.m
- saveasc.m
- savebinstl.m
- savebj.m
- savebnii.m
- savedxf.m
- savegts.m
- saveinr.m
- savejmesh.m
- savejnifti.m
- savejnii.m
- savejson.m
- savemedit.m
- savemphtxt.m
- savemsgpack.m
- savemsh.m
- savenifti.m
- savenirfast.m
- saveoff.m
- savesmf.m
- savestl.m
- savesurfpoly.m
- savetetgenele.m
- savetetgennode.m
- saveubjson.m
- savevrml.m
- slicesurf.m
- slicesurf3.m
- smoothbinvol.m
- smoothsurf.m
- sms.m
- sortmesh.m
- surf2mesh.m
- surf2vol.m
- surf2volz.m
- surfaceclean.m
- surfacenorm.m
- surfboolean.m
- surfdiffuse.m
- surfedge.m
- surfinterior.m
- surfpart.m
- surfplane.m
- surfreorient.m
- surfseeds.m
- surfvolume.m
- thickenbinvol.m
- thinbinvol.m
- TODO.txt
- uniqedges.m
- uniqfaces.m
- v2m.m
- v2s.m
- varargin2struct.m
- vol2mesh.m
- vol2restrictedtri.m
- vol2surf.m
- volface.m
- volmap2mesh.m
- zlibdecode.m
- zlibencode.m
readnirfast.m @debian/1.9.6+ds-1 — raw · history · blame
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | function nirfastmesh=readnirfast(filestub) % % nirfastmesh=readnirfast(v,f,filestub) % % load a group of mesh files saved in the NIRFAST format % % author: Qianqian Fang, <q.fang at neu.edu> % % input: % filestub: output file stub, output will include multiple files % filestub.node: node file % filestub.elem: element file to store the surface or tet mesh % filestub.param: parameter file % filestub.region: node label file % filestub.excoef: extinction coeff list % % output: % nirfastmesh.nodes: node list, 3 columns % nirfastmesh.elements: element list, 3 or 4 columns integers % nirfastmesh.bndvtx: boundary flag for each node, 1: on the boundary % nirfastmesh.region: node segmentation labels % nirfastmesh.dimension: dimension of the mesh % nirfastmesh.excoef: extinction coeff list % nirfastmesh.excoefheader: extinction coeff list field names % nirfastmesh.type: the header of the .param file % nirfastmesh.prop: optical property list (non-standard, need further processing) % % format definition see http://www.dartmouth.edu/~nir/nirfast/tutorials/NIRFAST-Intro.pdf % % example: % [node,face,elem]=meshabox([0 0 0],[10 10 10],0.3,1); % savenirfast(node,elem,'test', [], ones(size(node)), 'user'); % mymesh=readnirfast('test') % plotmesh([mymesh.nodes mymesh.bndvtx], mymesh.elements,'x>5') % % -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net) % fname=[filestub,'.node']; if(~exist(fullfile(pwd,fname),'file')) error([fname ' could not be found']); end nirfastmesh.nodes=load(fname); nirfastmesh.bndvtx=nirfastmesh.nodes(:,1); nirfastmesh.nodes(:,1)=[]; fname=[filestub,'.elem']; if(~exist(fullfile(pwd,fname),'file')) error([fname ' could not be found']); end nirfastmesh.elements=load(fname); nirfastmesh.dimension=size(nirfastmesh.elements,2)-1; fname=[filestub,'.region']; if(exist(fullfile(pwd,fname),'file')) nirfastmesh.region=load(fname); end fname=[filestub,'.excoef']; fid=fopen(fname,'rt'); if(fid>=0) linenum=0; textheader={}; while(~feof(fid)) oneline=fgetl(fid); linenum=linenum+1; [data, count]=sscanf(oneline,'%f'); if(count>1) params=fscanf(fid,repmat('%f ',1,count),inf); params=reshape(params,length(params)/count, count); params(2:end+1,:)=params; params(1,:)=data(:)'; nirfastmesh.excoef=params; nirfastmesh.excoefheader=textheader; break; else textheader{end+1}=oneline; end end fclose(fid); end fname=[filestub,'.param']; fid=fopen(fname,'rt'); if(fid>=0) linenum=0; params=[]; while(~feof(fid)) oneline=fgetl(fid); if(linenum==0) nirfastmesh.type=oneline; end linenum=linenum+1; [data, count]=sscanf(oneline,'%f'); if(count>1) params=fscanf(fid,repmat('%f ',1,count),inf); params=reshape(params,length(params)/count, count); params(2:end+1,:)=params; params(1,:)=data(:)'; nirfastmesh.prop=params; break; end end fclose(fid); end |