Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


MakeColorMap.m File Reference

Go to the source code of this file.


Functions

the function will suggest
a good number closest to the
one you chose Such a mighty
function Opt is a structure
containing the following fields 
Range (225/1) This specifies if RGB values are specified%in both Fiducials and M form 0-255(integers)%or 0-1 floats.%.SkipLast(0/1) if set to 0
the function will suggest
a good number closest to the
one you chose Such a mighty
function Opt is a structure
containing the following fields
then the last color specified
in Fiducials is the last color
in M If set the last color
in M represents the color
that would come right before
the last one in Fifucials
This last option is usefull
when you re crating cyclical
color maps where the last
color in Fiduciasl is like
the first 
Showme (0/1) optional parameter to show a display of the map%.Write optional string.If supplied
 if (~isfield(Opt,'Range')|~isfield(Opt,'SkipLast'))
 fprintf (2, 'Error%s:Range or SkipLast fields missing.\n', FuncName)
end if (~isfield(Opt,'verbose'))
end if (~isfield(Opt,'Write'))
else if (filexist(Opt.Write))
return end end if (~isfield(Opt,'Showme'))
end if (size(Fiducials, 2)~=3)
return end if (size(Fiducials, 1) > Ncols)
 if (~isempty(tmp))
number of fiducial colours if (~Opt.SkipLast)
 if (Npergap~=round(Npergap))
 if (Opt.SkipLast) Ncolsgood
 for (i=1:1:Ngap)
 if (Fiducials(i, 1)~=Fiducials(i+1, 1))
end if (Fiducials(i, 2)~=Fiducials(i+1, 2))
end if (Fiducials(i, 3)~=Fiducials(i+1, 3))
 if (i< Ngap|~Opt.SkipLast)
 M (im:im2,:)
else M (im:im2-1,:)
end colormap (Mrgb)
 image ([1:1:length(Mrgb(:, 1))])
 pie (ones(1, length(Mrgb(:, 1))))
end if (~isempty(Opt.Write))
end wryte2 (M, 3, Opt.Write,'on')

Variables

 function [err, M]
the function will suggest
a good number closest to the
one you chose Such a mighty
function Opt is a structure
containing the following fields
then the last color specified
in Fiducials is the last color
in M If set 
to
the function will suggest
a good number closest to the
one you chose Such a mighty
function Opt is a structure
containing the following fields
then the last color specified
in Fiducials is the last color
in M If set the last color
in M represents the color
that would come right before
the last one in Fifucials
This last option is usefull
when you re crating cyclical
color maps where the last
color in Fiduciasl is like
the first M is written to
the file specified by Write
Output 
Parameters
the function will suggest
a good number closest to the
one you chose Such a mighty
function Opt is a structure
containing the following fields
then the last color specified
in Fiducials is the last color
in M If set the last color
in M represents the color
that would come right before
the last one in Fifucials
This last option is usefull
when you re crating cyclical
color maps where the last
color in Fiduciasl is like
the first M is written to
the file specified by Write
Output default is More 
Info
Opt Range = 255
Opt SkipLast = 1
Opt Write = ''
you ll get [err, M] = MakeColorMap (Fiducials,7,Opt)
 M
and ScaleToMap Author
initailize return variables err = 1
 return
end Opt verbose = 0
return end end Opt Showme = 1
return end Check for some
weird input 
tmp = find (Fiducials < 0)
 serr = sprintf('Err_Values in Fiducials should not exceed Opt.Range (%g).',Opt.Range)
 Nfid = size (Fiducials,1)
number of fiducial colours Ninter = Ncols - Nfid
end Ngap = Nfid - 1
total number of gaps to fill
You must have an equal number
of colours in each gap 
Npergap = Ninter ./ Ngap
else Ncolsgood = round(Npergap) .* Ngap + Nfid
end Start forming M cnt = 0
 im = 1
 M1 = linspace(Fiducials(i,1),Fiducials(i+1,1),Npergap+2)'
end M2 = linspace(Fiducials(i,2),Fiducials(i+1,2),Npergap+2)'
end M3 = linspace(Fiducials(i,3),Fiducials(i+1,3),Npergap+2)'
end im2 = im+Npergap+1
end figure
 Mrgb = M ./ 255
 subplot

Function Documentation

end colormap Mrgb   ) 
 

for = 1:1:Ngap  ) 
 

fprintf ,
'Error%s:Range or SkipLast fields missing.\n ,
FuncName 
 

end if isempty(Opt.Write)  ) 
 

if  ) 
 

end if Fiducials(i, 3)~  = Fiducials(i+1,3)  ) 
 

end if Fiducials(i, 2)~  = Fiducials(i+1,2)  ) 
 

if Fiducials(i, 1)~  = Fiducials(i+1,1)  ) 
 

if Opt.  SkipLast  ) 
 

if Npergap = round(Npergap)  ) 
 

number of fiducial colours if ~Opt.  SkipLast  ) 
 

if isempty(tmp)  ) 
 

return end if size(Fiducials, 1)  ,
Ncols 
 

end if size(Fiducials, 2)~  = 3  ) 
 

return end end if isfield(Opt,'Showme')  ) 
 

else if filexist(Opt.Write  ) 
 

end if isfield(Opt,'Write')  ) 
 

end if isfield(Opt,'verbose')  ) 
 

if isfield(Opt,'Range')|~isfield(Opt,'SkipLast')  ) 
 

image  ) 
 

else M im:im2-  1,
 

M im:im2  ,
 

pie [1:1:length(Mrgb(:, 1))] ones(1, length(Mrgb(:, 1)))   ) 
 

the function will suggest a good number closest to the one you chose Such a mighty function Opt is a structure containing the following fields Range 225/  1  ) 
 

the function will suggest a good number closest to the one you chose Such a mighty function Opt is a structure containing the following fields then the last color specified in Fiducials is the last color in M If set the last color in M represents the color that would come right before the last one in Fifucials This last option is usefull when you re crating cyclical color maps where the last color in Fiduciasl is like the first Showme 0/  1  ) 
 

end wryte2 ,
,
Opt.  Write,
'on
 


Variable Documentation

and ScaleToMap Author
 

Definition at line 53 of file MakeColorMap.m.

end Start forming M cnt = 0
 

Definition at line 143 of file MakeColorMap.m.

end err = 1
 

Definition at line 199 of file MakeColorMap.m.

plot it Remember that indexing in matlab is always augmented by relative to AFNI s figure
 

function[err, M]
 

Initial value:

 MakeColorMap (Fiducials,Ncols,Opt)
%
%   [err,M] = MakeColorMap (Fiducials,Ncols,Opt)
%
%Purpose:
%   returns the RGB colormap containing Ncols that vary linearily 
%   from the first color in Fiducials to the last.
%   
%Input Parameters:
%   Fiducials : Nx3 matix specifying the RGB values (0-255) or 
%              (0-1) depending on the value of Opt.Range. Those
%              fiducial colours will be equally spaced on the map
%   Ncols : Total number of colours in the map   
%           You are somewhat restricted in the total number of 
%           colours you choose. You must choose a number that 
%           allows you to have the same number of colours between
%           each successive fiducials. Do not worry

Definition at line 1 of file MakeColorMap.m.

you ll get[err, M] = MakeColorMap (Fiducials,7,Opt)
 

Definition at line 52 of file MakeColorMap.m.

end im = 1
 

Definition at line 171 of file MakeColorMap.m.

Referenced by adwarp_refashion_dataset(), AFNI_brick_to_mri(), AFNI_faceup(), AFNI_finalize_saveim_CB(), AFNI_overlay(), AFNI_read_images(), AFNI_read_inputs(), AFNI_refashion_dataset(), AFNI_set_valabel(), AIVVV_imseq_getim(), AIVVV_imseq_popup(), AREN_render(), CALC_read_opts(), clustedit3D(), draw_image_line(), draw_xhairs_in_image(), drive_MCW_grapher(), dset_to_mri(), e_d(), extract_byte_fs(), extract_byte_liby(), extract_byte_lifl(), extract_byte_lix(), extract_byte_lixx(), extract_byte_nn(), extract_byte_ts(), extract_byte_tsx(), extract_rgba_nn(), extract_ts_array(), FD_brick_to_mri(), FD_brick_to_series(), ge4_validate_header(), get_line_opt(), get_octant_clips(), get_options(), getplane_byte(), idisp_ge4_image_header(), IM_main(), IMREG_main(), init_floatvector_array(), init_regression_analysis(), initialize_noise_model(), initialize_program(), initialize_signal_model(), ISQ_index_to_rgb(), ISQ_make_bar(), ISQ_make_image(), ISQ_make_montage(), ISQ_manufacture_one(), ISQ_process_mri(), ISQ_record_getim(), ISQ_saver_CB(), ISQ_show_zoom(), ISQ_statify_one(), ISQ_statistics_WP(), JPEG_matrix_gray(), main(), matrix_file_read(), MCW_erode_clusters(), MCW_find_clusters(), MCW_pbar_to_mri(), memplot_to_RGB_sef(), MREN_render(), mri_2dalign_many(), mri_2dalign_one(), mri_3dalign_many(), mri_3dalign_one(), MRI_5blur_inplace_3D(), mri_add_fname_delay(), mri_add_name(), mri_aff2d_byte(), mri_aff2d_rgb(), mri_affine_bicubic(), mri_automask_image(), mri_brainormalize(), mri_colorsetup(), mri_complex_abs(), mri_complex_phase(), mri_cut_2D(), mri_cut_3D(), mri_data_pointer(), mri_drawemptyrectangle(), mri_drawfilledrectangle(), mri_drawline(), mri_drawtext(), mri_edgize(), mri_entropy16(), mri_entropy8(), mri_fft2D(), mri_fft_complex(), mri_filt_fft(), mri_fix_data_pointer(), mri_flatten(), mri_flatten_rgb(), mri_flippo(), mri_float_func(), mri_free(), mri_get_cmass_2D(), mri_get_cmass_3D(), mri_histobyte(), mri_histogram(), mri_histoshort_all(), mri_histoshort_nonneg(), mri_inflate_pbm(), mri_input_delay(), mri_invert_inplace(), mri_isgray(), mri_max(), mri_maxabs(), mri_min(), mri_percents(), mri_purge_delay(), mri_quantile(), mri_quantize(), mri_read(), mri_read_dicom(), mri_read_ge4(), mri_read_just_one(), mri_read_many_nsize(), mri_read_mpeg(), mri_read_stuff(), mri_resize(), mri_resize_NN(), mri_rgb_transform_nD(), mri_rgba_composite_two(), mri_rgba_composite_VA(), mri_rota(), mri_rota_bilinear(), mri_rota_shear(), mri_rota_variable(), mri_rotate(), mri_rotate_bilinear(), mri_scale_inplace(), mri_sharpen(), mri_sharpen_rgb(), mri_shift2D_bilinear(), mri_shift_1D(), mri_short2mask(), mri_squareaspect(), mri_swapbytes(), mri_threshold(), mri_to_niml(), mri_to_short_scl(), mri_to_XImage(), mri_transpose(), mri_transpose_byte(), mri_transpose_complex(), mri_transpose_float(), mri_transpose_int(), mri_transpose_rgbyte(), mri_transpose_short(), mri_try_7D(), mri_try_mri(), mri_try_pgm(), mri_uncat2D(), mri_warp(), mri_warp3D(), mri_warp3D_affine(), mri_warp3d_align_one(), mri_warp3D_align_setup(), mri_warp3D_cubic(), mri_warp3D_linear(), mri_warp3D_NN(), mri_warp3D_quintic(), mri_warp3D_resize(), mri_warp_bicubic(), mri_warp_bilinear(), mri_watershedize(), mri_write(), mri_write_1D(), mri_write_7D(), mri_write_analyze(), mri_write_ascii(), mri_write_jpg(), mri_write_pnm(), mri_write_raw(), mri_zeropad_3D(), NIH_find_clusters(), niml_to_mri(), NL_main(), NUD_doall_CB(), NUD_rotate(), NUD_update_base(), partial_cliplevel(), PH_fakeim(), PH_loadim(), PH_popup_image(), plot_image_surface(), PLOT_matrix_gray(), PLUGIN_imseq_getim(), PLUGIN_init(), PLUTO_imseq_addto(), PLUTO_imseq_getim(), PLUTO_imseq_popim(), PLUTO_imseq_popup(), PLUTO_popup_image(), process_1ddata(), process_NIML_MRI_IMAGE(), project_byte_mip(), putplane_byte(), r_fill_resampled_data_brick(), r_mri_read_dicom(), rcr_disp_hist(), RCREND_finalize_saveim_CB(), RCREND_imseq_getim(), read_dicom_image(), read_new_im(), read_nodes_file(), read_one_time_series(), read_sxyz_1D(), read_time_series(), read_ts_array(), REND_finalize_saveim_CB(), REND_imseq_getim(), Resample(), rgb_to_XImage(), rgb_to_XImage_clever(), rgb_to_XImage_simple(), RT_read_image(), RT_registration_2D_onevol(), RT_registration_2D_setup(), RT_registration_3D_setup(), sdata_from_1D(), SNAP_imseq_getim(), SPLASH_decodexx(), SPLASH_imseq_getim(), SPLASH_popup_image(), SUMA_Load1DDset(), SUMA_Load_Surface_Object_eng(), SUMA_LoadDXDset(), SUMA_MakeColorMap(), SUMA_MakeColorMap_v2(), SUMA_OpenDrawnROI_1D(), SUMA_Read_Color_Map_1D(), SUMA_Read_IRGB_file(), SUMA_read_ppm(), SUMA_readFScurv(), SUMA_ReadSegDO(), SUMA_RegisterEngineData(), SUMA_RegisterEngineListCommand(), SUMA_SmoothAttr_Neighb(), SUMA_SwitchState(), SUMA_VEC_Read(), T3D_read_images(), THD_3dim_from_block(), THD_average_one_timeseries(), THD_cliplevel(), THD_cmass(), THD_datablock_apply_atr(), THD_dset_in_session(), THD_extract_float_brick(), THD_extract_many_series(), THD_extract_series(), THD_fetch_many_datasets(), THD_get_brick_stats(), THD_load_datablock(), THD_load_mpeg(), THD_mask_clip_neighbors(), THD_mask_clust(), THD_mask_dilate(), THD_mask_distize(), THD_mask_erode(), THD_open_mpeg(), THD_orient_guess(), THD_rota3D(), THD_rota3D_matvec(), THD_set_dataset_attributes(), THD_write_datablock(), Track_Vpointer(), TTget_ppm(), TTget_recv(), and UC_read_opts().

end im2 = im+Npergap+1
 

Definition at line 165 of file MakeColorMap.m.

Referenced by main(), mri_2dalign_one(), mri_2dalign_setup(), mri_align_dfspace(), and TFIM_getopts().

the function will suggest a good number closest to the one you chose Such a mighty function Opt is a structure containing the following fields then the last color specified in Fiducials is the last color in M If set the last color in M represents the color that would come right before the last one in Fifucials This last option is usefull when you re crating cyclical color maps where the last color in Fiduciasl is like the first M is written to the file specified by Write Output default is More Info
 

Definition at line 37 of file MakeColorMap.m.

end make sure format for output is good needs to be integer output M
 

Initial value:

%
%   255     0     0
%   128   128     0
%     0   255     0
%     0   128   128
%     0     0   255
%   128     0   128
%   255     0     0
%
%   see also rgbdectohex

Definition at line 178 of file MakeColorMap.m.

else M1 = linspace(Fiducials(i,1),Fiducials(i+1,1),Npergap+2)'
 

Definition at line 149 of file MakeColorMap.m.

else M2 = linspace(Fiducials(i,2),Fiducials(i+1,2),Npergap+2)'
 

Definition at line 155 of file MakeColorMap.m.

else M3 = linspace(Fiducials(i,3),Fiducials(i+1,3),Npergap+2)'
 

Definition at line 161 of file MakeColorMap.m.

else Mrgb = M ./ 255
 

Definition at line 186 of file MakeColorMap.m.

else Ncolsgood = round(Npergap) .* Ngap + Nfid
 

Definition at line 136 of file MakeColorMap.m.

Referenced by SUMA_MakeColorMap().

Nfid = size (Fiducials,1)
 

Definition at line 121 of file MakeColorMap.m.

Referenced by SUMA_MakeColorMap(), and SUMA_MakeColorMap_v2().

end Ngap = Nfid - 1
 

Definition at line 129 of file MakeColorMap.m.

Referenced by SUMA_MakeColorMap().

total number of intermediate colours else Ninter = Ncols - Nfid
 

Definition at line 126 of file MakeColorMap.m.

Referenced by SUMA_MakeColorMap().

total number of gaps to fill You must have an equal number of colours in each gap Npergap = Ninter ./ Ngap
 

Definition at line 132 of file MakeColorMap.m.

Referenced by SUMA_MakeColorMap().

the function will suggest a good number closest to the one you chose Such a mighty function Opt is a structure containing the following fields then the last color specified in Fiducials is the last color in M If set the last color in M represents the color that would come right before the last one in Fifucials This last option is usefull when you re crating cyclical color maps where the last color in Fiduciasl is like the first M is written to the file specified by Write Output Parameters
 

Definition at line 37 of file MakeColorMap.m.

Opt Range = 255
 

Definition at line 41 of file MakeColorMap.m.

Referenced by SUMA_ScaleToMap_Interactive().

return
 

Definition at line 200 of file MakeColorMap.m.

end serr = sprintf('Err_Values in Fiducials should not exceed Opt.Range (%g).',Opt.Range)
 

Definition at line 137 of file MakeColorMap.m.

Referenced by RCREND_state_to_widgets(), REND_state_to_widgets(), SUMA_IV_FaceSetsextract(), and SUMA_IV_XYZextract().

return end end Opt Showme = 1
 

Definition at line 95 of file MakeColorMap.m.

Opt SkipLast = 1
 

Definition at line 41 of file MakeColorMap.m.

Referenced by SUMA_MakeColorMap(), and SUMA_MakeColorMap_v2().

subplot
 

Definition at line 191 of file MakeColorMap.m.

return end tmp = find (Fiducials < 0)
 

Definition at line 112 of file MakeColorMap.m.

the function will suggest a good number closest to the one you chose Such a mighty function Opt is a structure containing the following fields then the last color specified in Fiducials is the last color in M If set to
 

Definition at line 25 of file MakeColorMap.m.

Referenced by calculate_acontrasts(), calculate_adifferences(), calculate_ameans(), calculate_bcontrasts(), calculate_bdifferences(), calculate_bmeans(), calculate_fa(), calculate_fab(), calculate_fb(), calculate_ftr(), calculate_ss0(), calculate_ssa(), calculate_ssab(), calculate_ssb(), calculate_sse(), calculate_ssi(), calculate_ssij(), calculate_ssijk(), calculate_ssj(), calculate_sstr(), calculate_sum(), calculate_xcontrasts(), calculate_xdifferences(), calculate_xmeans(), check_for_valid_inputs(), copy(), copyData(), create_bucket(), dsort(), F1D_chainfunc(), huber_func(), ncio_ffio_move(), ncio_px_move(), ncio_spx_move(), px_double_buffer(), and terminate().

end check on options Opt verbose = 0
 

Definition at line 163 of file WriteBrik.m.

Referenced by EDIT_one_dataset(), F3D_initialize_user_data(), GIF_Image_Header(), GIF_Loop(), GIF_Screen_Header(), main(), mri_3dalign_method(), mri_3dalign_one(), mri_3dalign_setup(), mri_align_dfspace(), mri_dicom_header(), MTD_killfunc(), new_RT_input(), PERMTEST_compute(), PLUGIN_init(), RT_check_listen(), RT_fim_recurse(), RT_finish_dataset(), RT_main(), RT_process_data(), RT_process_image(), RT_process_info(), RT_process_xevents(), RT_registration_2D_atend(), RT_registration_2D_onevol(), RT_registration_2D_realtime(), RT_registration_3D_atend(), RT_registration_3D_onevol(), RT_registration_3D_realtime(), RT_registration_3D_setup(), RT_start_child(), RT_start_dataset(), RT_tell_afni(), RT_tell_afni_one(), RT_worker(), scan_JPEG_header(), THD_dataset_info(), THD_load_datablock(), THD_load_datablock_verbose(), and THRESH_compute().

end Opt Write = ''
 

Definition at line 87 of file MakeColorMap.m.

 

Powered by Plone

This site conforms to the following standards: