Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
dbForge Studio for PostgreSQL 2.3.212
HTMLPad 2020 16.2
WeBuilder 2020 16.2
Rapid CSS 2020 16.2
Rapid PHP 2020 16.2
C# HTML to PDF 2020.8.1
Flowrigami 1.0.0.1
Vue Injector 3.3
Spectrum Analyzer pro Live 2019
Devart Excel Add-in for HubSpot 2.1
RentALLScript - Airbnb clone 2.2
SuiteCRM Theme Customization 7.11.6
iScripts NetMenus 3.1
iScripts EasyIndex 2.2
iScripts EasySnaps 2.0
Top Code
IcrediBB Bulletin Board System 1.0
Skincare Management System for Scripts 1.4
Taxi Booking Script 1.0.4
Extreme Injector 3.7
Readability Analyzer 7.x-1.0-rc2
Sportsbook software by BOOKIE Software 3.01
Betting system 6.x-1.x-dev
Unix Time Stamp Calculator 1.0
Two Dimensional Random Walk 1.0
shopping mall management system 1.0
Uber Clone with Safety Measure Addons 2.0
phpEnter 5.1.
Single Leg MLM 1.2.1
Availability Booking Calendar PHP 1.0
Azizi search engine script PHP 4.1.10
Top Rated
Uber Clone with Safety Measure Addons 2.0
Answers phpSoftPro 3.12
phpEnter 5.1.
Quick Maps For Dynamics CRM 3.1
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Apphitect Airbnb Clone Script 1.0
Deals and Discounts Website Script 1.0.2
Pro MLM 1
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ind2patch 1.0
File ID: 79437






ind2patch 1.0
Download ind2patch 1.0http://www.mathworks.comReport Error Link
License: Freeware
File Size: 10.0 KB
Downloads: 1
Submit Rating:
ind2patch 1.0 Description
Description: This function generates patch data (faces d-deDUFd-deDt, vertices d-deDUVd-deDt and color data d-deDUCd-deDt) for 3D images. The patches are only generated for the voxels specified by the linear indices in d-deDUINDd-deDt. The variable d-deDUptyped-deDt indicates
the type of patch:

d-de?vd-deOao Voxel (box)
d-de?sxd-deOao, d-de?syd-deOao, d-de?szd-deOao Mid-voxel slice for x, y and z direction respectively
EXAMPLE
clear all; close all; clc;

Simulating 3D image
[X,Y,Z]=meshgrid(linspace(-4.77,4.77,75));
phi=(1+sqrt(5))/2;
M=2 - (cos(X + phi*Y) + cos(X - phi*Y) + cos(Y + phi*Z) + cos(Y - phi*Z) + cos(Z - phi*X) + cos(Z + phi*X));
M=M./max(M(:)); %Normalise, not required

figure;fig=gcf; clf(fig); colordef (fig, 'white'); units=get(fig,'units'); set(fig,'units','normalized','outerposition',[0 0 1 1]); set(fig,'units',units); set(fig,'Color',[1 1 1]);
hold on; xlabel('X-J','FontSize',20);ylabel('Y-I','FontSize',20);zlabel('Z-K','FontSize',20);

Creating and plotting patch data

Setting up indices for slices to plot
S=round(size(M,2)./2);
L_slices=false(size(M));
L_slices(:,S,:)=1;
IND_slices=find(L_slices);
[Fs,Vs,C_slice]=ind2patch(IND_slices,M,'sx'); %Creating patch data for x mid-voxel slices
hs=patch('Faces',Fs,'Vertices',Vs,'EdgeColor','none', 'CData',C_slice,'FaceColor','flat','FaceAlpha',0.75);

Setting up indices for slices to plot
S=round(size(M,1)./2);
L_slices=false(size(M));
L_slices(S,:,:)=1;
IND_slices=find(L_slices);
[Fs,Vs,C_slice]=ind2patch(IND_slices,M,'sy'); %Creating patch data for y mid-voxel slices
hs=patch('Faces',Fs,'Vertices',Vs,'EdgeColor','none', 'CData',C_slice,'FaceColor','flat','FaceAlpha',0.75);

Setting up indices for slices to plot
S=round(size(M,3)./2);
L_slices=false(size(M));
L_slices(:,:,S)=1;
IND_slices=find(L_slices);
[Fs,Vs,C_slice]=ind2patch(IND_slices,M,'sz'); %Creating patch data for z mid-voxel slices
hs=patch('Faces',Fs,'Vertices',Vs,'EdgeColor','none', 'CData',C_slice,'FaceColor','flat','FaceAlpha',0.75);

Setting up indices for voxels to plot
IND=find(M>-0.2 & M<=0);
[Fs,Vs,C_slice]=ind2patch(IND,M,'v'); %Creating patch data for selection of low voxels
hs=patch('Faces',Fs,'Vertices',Vs,'EdgeColor','k', 'CData',C_slice,'FaceColor','flat','FaceAlpha',1);

Setting up indices for voxels to plot
IND=find(M>0.9);
[Fs,Vs,C_slice]=ind2patch(IND,M,'v'); %Creating patch data for selection of high voxels
hs=patch('Faces',Fs,'Vertices',Vs,'EdgeColor','k', 'CData',C_slice,'FaceColor','flat','FaceAlpha',1);

axis equal; view(3); axis tight; colormap jet; colorbar; caxis([0 1]); grid on;
set(gca,'FontSize',20);

License: Freeware

Related: datasetting, Plotting, Creating, slices, sliceshs dpatch faces vertices edgecolor, midvoxel, xlabel fontsize ylabel fontsize zlabel fontsize, hold, White, colordef, clffig, units dgetfig units, setfig units normalized outerposition, setfig color, setfig u

O/S:BSD, Linux, Solaris, Mac OS X

File Size: 10.0 KB

Downloads: 1



User Review for ind2patch
- required fields
     

Please enter text on the image