0001 function pfsview_rgb( varargin )
0002
0003
0004
0005
0006
0007
0008
0009
0010 if( nargin == 3 )
0011 if( ~isnumeric(varargin{1}) || ~isnumeric(varargin{2}) || ~isnumeric(varargin{1}) )
0012 error( 'pfsview_rgb: matrices of the equal size expected as an arguments' );
0013 end
0014 [X Y Z] = pfs_transform_colorspace( 'RGB', varargin{1}, varargin{2}, varargin{3}, 'XYZ' );
0015 [height width] = size( varargin{1} );
0016 elseif( nargin == 1 && ndims(varargin{1}) == 3 )
0017 [X Y Z] = pfs_transform_colorspace( 'RGB', varargin{1}(:,:,1), varargin{1}(:,:,2), varargin{1}(:,:,3), 'XYZ' );
0018 [height width] = size( varargin{1}(:,:,1) );
0019 else
0020 error( 'pfsview_rgb: improper usage' );
0021 end
0022
0023
0024 if( exist( 'window_min', 'var' ) == 1 && exist( 'window_max', 'var' ) == 1 )
0025 minmax_window = sprintf( '--window_min %g --window_max %g ', window_min, window_max );
0026 else
0027 minmax_window = '';
0028 end
0029
0030
0031
0032 tmp_file = tempname();
0033
0034 pfsout = pfsopen( tmp_file, height, width );
0035 pfsout.channels.X = X;
0036 pfsout.channels.Y = Y;
0037 pfsout.channels.Z = Z;
0038 pfsout.tags.FILE_NAME = 'matlab';
0039 pfsput( pfsout );
0040 pfsclose( pfsout );
0041
0042 system( sprintf( '%s(pfsview <''%s'' && rm -f %s) &%s', pfs_shell(), tmp_file, tmp_file, pfs_shell( 1 ) ) );
0043
0044 end