Home > cellorganizer > savedatfile.m

savedatfile

PURPOSE ^

This function saves .dat file for loading primitives into blender

SYNOPSIS ^

function savedatfile(savepath,resolution,downsample)

DESCRIPTION ^

This function saves .dat file for loading primitives into blender
currently it saves a single .dat file for each endosome with only size
data. 

Inputs: 
savepath = string pointing to the desired folder to save the .dat files

Outputs:
set of .dat files 

Author: Devin Sullivan July 23, 2013

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function savedatfile(savepath,resolution,downsample)
0002 %This function saves .dat file for loading primitives into blender
0003 %currently it saves a single .dat file for each endosome with only size
0004 %data.
0005 %
0006 %Inputs:
0007 %savepath = string pointing to the desired folder to save the .dat files
0008 %
0009 %Outputs:
0010 %set of .dat files
0011 %
0012 %Author: Devin Sullivan July 23, 2013
0013 mkdir(savepath)
0014 
0015 if isempty(resolution)
0016     resolution = [1,1,1];
0017 end
0018 
0019 if isempty(downsample)
0020     downsample = [1,1,1];
0021 end
0022 
0023 if size(downsample)==1
0024     downsample = [downsample,downsample,downsample];
0025 end
0026 
0027 %first load temp results
0028 load([pwd filesep 'temp' filesep 'primitives']);
0029 % objsizevec = objsizevec.*repmat(resolution,[size(objsizevec,1),1]);
0030 % objsizevec = objsizevec.*repmat(downsample,[size(objsizevec,1),1]);
0031 
0032 filename = [savepath '.dat'];
0033 
0034 for i = 1:size(objsizevec,1)
0035     
0036     dlmwrite(filename,['Endosome[',num2str(i),']'],'delimiter','','-append');
0037     dlmwrite(filename,objsizevec(i,:),'delimiter',' ','-append');
0038     dlmwrite(filename,objposvec(i,:),'delimiter',' ','-append');
0039     dlmwrite(filename,objrotvec(i,:),'delimiter',' ','-append');
0040 %     dlmwrite(filename,'cube','delimiter','','-append');
0041 %     dlmwrite(filename,objsizevec(i,:)*2,'delimiter',' ','-append');
0042 end

Generated on Sun 29-Sep-2013 18:44:06 by m2html © 2005