plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | Abakumov/MLIB-master | s_cplot.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/s_cplot.m | 19,603 | utf_8 | e95b0b24a71e60e9219c74f10bc647c5 | function aux=s_cplot(seismic,varargin)
% Plot seismic data in color-coded form.
%
% Written by: E. Rietsch: May 16, 2000
% Last updated: October 24, 2009: Remove the lines between facets
% (parameter "shading")
%
% aux=s_cplot(seismic,varargin)
% INPUT
% seismic seismic structure
% v... |
github | Abakumov/MLIB-master | read_las_file.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/read_las_file.m | 5,604 | utf_8 | 67e4827a715b5dca7711a5a4c860b9ab | function wlog=read_las_file(filename,varargin)
% Function reads well logs from a disk file in LAS format (Log ASCII Standard)
% Versions 2.0 or 3.0 as specified by the Canadian Well Logging Society.
% See also: "read_las2_file"
%
% Written by: E. Rietsch: December 15, 2006;
% Last updated: October 12, 2007: remove f... |
github | Abakumov/MLIB-master | s_create_qfilter.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/s_create_qfilter.m | 3,649 | utf_8 | 653c5f5d0ffbf454f9275950598ab48f | function qf=s_create_qfilter(varargin)
% Function computes a series of constant-Q absorption filters. These filters have
% an amplitude spectrum equal to exp(-pi*f*t/Q) where f is frequency, t is travel
% time, and Q denotes the quality factor (usually in the range of 30 to 200).
% The total number of traces output e... |
github | Abakumov/MLIB-master | s_spectrum2wavelet.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/s_spectrum2wavelet.m | 3,686 | utf_8 | fefc784e467d1c3d52b51e2d1b682b19 | function wavelet=s_spectrum2wavelet(freq,amps,varargin)
% Compute zero-phase wavelet from its amplitude spectrum;
% unless spectral amplitudes are defined for zero frequency and/or Nyquist
% frequency (i.e. freq(1) == 0 and/or freq(end) == 500/step) they are set
% to zero.
%
% Written by: E. Rietsch: November 27, 2004... |
github | Abakumov/MLIB-master | read_las2_file.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/read_las2_file.m | 18,770 | utf_8 | 2c29248cebe60ad5c5580af2cefa4a69 | function [wlog,las_header]=read_las2_file(filename,iprint)
% Function reads well logs from a disk file in LAS format (Log ASCII Standard),
% Version 2.0, as specified by the Canadian Well Logging Society.
% Generally somewhat faster than "read_las_file" but may be deprecated in
% the future.
% See also: read_las_file
... |
github | Abakumov/MLIB-master | show_segy_header.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/show_segy_header.m | 2,859 | utf_8 | 4bd3527ee2effbdee496ea4c6265bc38 | function header=show_segy_header(filename)
% Function displays the EBCDIC header of a SEG-Y file
% Date Feb. 20, 2000; written by E. Rietsch
% INPUT
% filename name of the file
% if the name is omitted or does not refer to an existing file
% a file selector box will pop up to allow interac... |
github | Abakumov/MLIB-master | s_shift.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/s_shift.m | 6,837 | utf_8 | 4614f27f8884374473742651300926f2 | function seismic=s_shift(seismic,varargin)
% Function applies user-specified time shifts to seismic traces
%
% Written by: E. Rietsch: July 2001
% Last updated: March 23, 2008: bug fix for constant shift; output
% precision is input precision
%
% seismic=s_shift(seismic,vararg... |
github | Abakumov/MLIB-master | s_wavextra.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/s_wavextra.m | 13,805 | utf_8 | 69e64aa24cda0071b2063aa33670384c | function [wavelet,aux]=s_wavextra(seismic,refl,varargin)
% Function extracts wavelet from seismic data using a log-derived
% reflectivity sequence.
%
% Written by E. Rietsch, May 6, 2000
% Last update: January 16, 2007: Discontinued use of "spdiags"
%
% [wavelet,aux]=s_wavextra(seismic,refl,varargin)
% INPUT... |
github | Abakumov/MLIB-master | write_segy_file.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/write_segy_file.m | 20,874 | utf_8 | 69b0175b19bd94329d6a7426a85b3501 | function write_segy_file(seismic,filename,varargin)
% Function writes seismic data to disk in SEG-Y file format.
% If the start time is greater than zero, zeros are prepended. If it is less
% than zero, a warning message is printed.
% The only floating-point format supported is IEEE big-endian, which is one of
% th... |
github | Abakumov/MLIB-master | s_resample.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/s_resample.m | 7,673 | utf_8 | 48867adae303fed7f8360b744e370d69 | function seismic=s_resample(seismic,sample_interval,varargin)
% Function resamples seismic data to new sample interval. If the new sample
% interval is greater than the old sample interval and interpolation is done
% in the time domain an Ormsby filter with corner frequencies
% 0, 0, 0.8*fnyquist, fnyquist
% is... |
github | Abakumov/MLIB-master | s_append.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/s_append.m | 10,541 | utf_8 | e94f42634b346c9d4d692ffd41fcd27f | function seisout=s_append(seis1,seis2,varargin)
% Function combines two seismic data sets. On output the traces of the
% first input data set are followed by the traces of the second data set.
% The two data sets must satisfy the following two conditions:
% seis1.step=seis2.step;
% (seis1.first-sei... |
github | Abakumov/MLIB-master | l_unit_conversion.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/l_unit_conversion.m | 9,388 | utf_8 | 06ff65819756cdfd19ceda825126499a | function wlog=l_unit_conversion(wlog,varargin)
% Function converts units of measurements of curves and parameters in
% a log structure.
%
% DEPRECATED: Use "ds_unit_conversion" instead.
%
% Written by: E. Rietsch: January 10, 2001
% Last updated: April 11, 2007: Bug fix
%
% wlog=l_unit_conversion(wlog,varargin... |
github | Abakumov/MLIB-master | s_stack.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/s_stack.m | 7,570 | utf_8 | 11e9433cb1c39f519396e2a281b8058b | function [stack,aux]=s_stack(seismic,varargin)
% Function stacks seismic traces (sums the traces of gathers and divides
% the sum by the number of valid samples added; normalization).
% It a header mnemonic is specified, traces with the same value of
% that header (gathers) are stacked; otherwise all traces of the i... |
github | Abakumov/MLIB-master | helpx.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/helpx.m | 2,177 | utf_8 | a0c250c0e79137c109cf98947d2cae71 | function warnings=helpx(func)
% Run the example in the help section of a function
% The help section starts with the line "% EXAMPLE"
string=blanks(80);
string=strrep(string,' ','=');
helptext = help(func);
if isempty(helptext)
warnings=['Function "',func,'" has no help section'];
return
end
%li... |
github | Abakumov/MLIB-master | create_button4tracking.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/create_button4tracking.m | 2,745 | utf_8 | abe461cec0859fa80b7f858108619779 | function button_handle=create_button4tracking(type_of_action)
% Create a menu item to track cursor movements
%
% Written by: E. Rietsch: August 31, 2003
% Last updated: January 8, 2004
%
% button_handle=create_button4tracking(type_of_action)
% INPUT
% type_of_action cell array or string with the... |
github | Abakumov/MLIB-master | showcell.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/showcell.m | 15,711 | utf_8 | 7cf9c7a0321ab88200801279b1c0b63a | function showcell(varargin)
%SHOWCELL Displays cell array with long strings in the command window.
% SHOWCELL(A) displays the contents of a cell array A in the command
% window. It will format the display so that long strings will display
% appropriately. A can be a cell array of numbers, strings, and/or ... |
github | Abakumov/MLIB-master | interpret_las2.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/interpret_las2.m | 6,780 | utf_8 | 22b4f7f0fd397be4e2624ab5e5fb3130 | function [wlog,aux]=interpret_las2(tlines,wrap)
% Interpret the lines of a file in LAS 3.0 format and create a well-log
% structure.
%
% Written by: E. Rietsch: December 19, 2006
% Last updated: February 7, 2007: Handle parameters without a preceding ~PARAMETER line
%
% [wlog,aux]=interpret_las2(tlines)... |
github | Abakumov/MLIB-master | wseismic_scrollbar_menu.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/wseismic_scrollbar_menu.m | 5,153 | utf_8 | efb498e845f3406baca9e904d41f0181 | function menu_handle=wseismic_scrollbar_menu(figure_handle,seismic,plotdir)
% Function creates a menu button on the figure with handle "figure_handle" (or
% the current figure) that allows one to add scroll bars to a wiggle seismic plot
%
% Written by: E. Rietsch, August 22, 2005
% Last updated: November 5, 2005: Save ... |
github | Abakumov/MLIB-master | create_menu_item4tracking.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/create_menu_item4tracking.m | 2,430 | utf_8 | d3a3a13bcc81b9e941b34f6f8b59122a | function button_handle=create_menu_item4tracking(type_of_action,button_handle)
% Create a menu item to track cursor movements
%
% Written by: E. Rietsch: August 31, 2003
% Last updated: January 8, 2004
%
% button_handle=create_button4tracking(type_of_action)
% INPUT
% type_of_action cell array o... |
github | Abakumov/MLIB-master | cseismic_scrollbar_menu_item.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/cseismic_scrollbar_menu_item.m | 5,115 | utf_8 | 37458559768477864c62f7229ca84cad | function menu_handle=cseismic_scrollbar_menu_item(figure_handle,options_menu_handle,seismic,plotdir)
% Function creates a menu button on the figure with handle "figure_handle"
% that allows one to add scroll bars to a color seismic plot
%
% Written by: E. Rietsch, August 22, 2005
% Last updated: November 5, 2005: Save... |
github | Abakumov/MLIB-master | axis_label_location.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/axis_label_location.m | 4,911 | utf_8 | 52719f3f36281be2243593d021aefe38 | function axis_label_location(handles,xll,yll)
% In a multi-plot figure created by "mysubplot" this function allows selection
% of the axes which should be annotated.
%
% Written by: E. Rietsch: March 19, 2009
% Last updated:
%
%
% INPUT
% handles matrix of handle values as output by function "mysubplot".
% ... |
github | Abakumov/MLIB-master | menu2pick_frequency_windows.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/menu2pick_frequency_windows.m | 10,172 | utf_8 | 8d3c03e75c86b2f261410434e502baf5 | function MenuHandle=menu2pick_frequency_windows(figure_handle)
% Create menu button to pick rectangular windows; the spectrum of the data
% is posted to a second window. The callback function that does
% all this is also in this file ("g_ispectrum") and passed on to the
% "outside world" via a "function handle".
%
% W... |
github | Abakumov/MLIB-master | progressbar.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/progressbar.m | 8,257 | utf_8 | 2e59acb2505884c1cc31640cdadefae0 | function handle = progressbar( handle,increment,string,titlestr)
%
% progressbar - shows a progress bar dialog based on the function "waitbar"
%
% Format: handle = progressbar( handle,increment [,string,titlestr] )
%
% Input: handle - handle to current progress bar, [] for a new one
% increment... |
github | Abakumov/MLIB-master | myimagemenu.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/myimagemenu.m | 7,016 | utf_8 | 2b0c5a6fa420b9dac2b5cb298b76ef93 | function myimagemenu(figure_handle)
%IMAGEMENU adds a context menu to change image properties
% IMAGEMENU(handle) creates a context menu for all images with the parent
% handle that allows image properties to be easily changed.
% IMAGEMENU, without any input arguments, will create this context menu
% for all im... |
github | Abakumov/MLIB-master | gui_patience.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/gui_patience.m | 4,230 | utf_8 | 98e2588976a4a5a369ddcb0da880b013 | function varargout = gui_patience(varargin)
% Create a message window; the message does not halt execution of the program
% Written by: E. Rietsch: October 2003
% Last updated: July 22, 2007: "mlint" compliant
%
% varargout = gui_patience(varargin)
% INPUT
% varargin(1) cell containing string with message ... |
github | Abakumov/MLIB-master | interpret_las3.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/interpret_las3.m | 19,064 | utf_8 | 09656a12a74dd413916e580e1779a596 | function [wlog,aux]=interpret_las3(tlines,param)
% Interpret the lines of a file in LAS 3.0 format and create a well-log
% structure. Called by "read_las_file".
%
% Written by: E. Rietsch: December 16, 2006
% Last updated: January 31, 2007: Write parameters only if they are not empty
%
% [wlog,aux]=inte... |
github | Abakumov/MLIB-master | cseismic_scrollbar_menu.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/cseismic_scrollbar_menu.m | 5,079 | utf_8 | b80249f4639f58be73e45931e5c3f316 | function menu_handle=cseismic_scrollbar_menu(figure_handle,seismic,plotdir)
% Function creates a menu button on the figure with handle "figure_handle"
% that allows one to add scroll bars to a color seismic plot
%
% Written by: E. R., August 22, 2005
% Last updated: November 5, 2005: Save axis limits before user querr... |
github | Abakumov/MLIB-master | histoplot1.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/histoplot1.m | 7,021 | utf_8 | de1fa709891c0c1193430cb181c83b32 | function aux=histoplot1(x,edges,varargin)
% Histogram plot (1-D)
%
% Written by: E. Rietsch: September 19, 2003
% Last updated: April 10, 2008: Generalize plotting of percentile lines
%
% aux=histoplot1(x,edges,varargin)
% INPUT
% x column vector of samples
% edges either the vector of edges for "... |
github | Abakumov/MLIB-master | read_traces_of_segy_file.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/read_traces_of_segy_file.m | 7,306 | utf_8 | ae9bef05ec52cc2dce0ab876d9b823dc | function [seismic,headers]=read_traces_of_segy_file(fid,seismic,param,parameters,max_no_of_traces)
% Read traces of the open SEG-Y file with file ID "fid". The file must have
% been opened with function "open_segy_file4reading". This function also
% provides the input arguments for this function.
% For internal u... |
github | Abakumov/MLIB-master | finalize_seismic_dataset.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/finalize_seismic_dataset.m | 2,939 | utf_8 | 1e51b66c8719f9fa1c644d61a0d1a826 | function seismic=finalize_seismic_dataset(seismic,headers,param,parameters)
% Called from "read_segy_file"
global S4M
if S4M.history
seismic=s_history(seismic,'add',seismic.from);
end
% Convert to IEEE format if necesssary
if strcmpi(param.format,'ibm')
if strcmpi(S4M.precision,'single')
seis... |
github | Abakumov/MLIB-master | remove_consecutive_blanks.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/remove_consecutive_blanks.m | 1,231 | utf_8 | 2d4f2ace3ea0c01a0f2f717f17ec0525 | function str=remove_consecutive_blanks(str)
% Remove consecutive blanks in the input string (or a cell vector of strings)
% and replace them by a single blank.
% Also remove any leading and trailing blanks.
%
% Written by: E. Rietsch: December 19, 2006
% Last updated:
%
% str=remove_consecutive_blanks(st... |
github | Abakumov/MLIB-master | wseismic_scrollbar_menu_item.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/wseismic_scrollbar_menu_item.m | 5,179 | utf_8 | 4dac21bb80442d7d124af2e9668a2dac | function menu_handle=wseismic_scrollbar_menu(figure_handle,options_menu_handle,seismic,plotdir)
% Function creates a menu button on the figure with handle "figure_handle" (or
% the current figure) that allows one to add scroll bars to a wiggle seismic plot
%
% Written by: E. Rietsch, August 22, 2005
% Last updated: Nov... |
github | Abakumov/MLIB-master | curve_indices.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/curve_indices.m | 2,714 | utf_8 | f29cf2b0f2baba31d2c3a3127b8e5158 | function indices=curve_indices(wlog,mnems,abort)
% Function outputs the column indices of curves in log structure "wlog".
% For any mnemonic in "mnem" for which there is no curve in "wlog" the
% corresponding value of "indices" is set to zero.
% See also: curve_index1
%
% Written by: E. Rietsch: May 2000
% Last update... |
github | Abakumov/MLIB-master | menu2edit_seismic.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/menu2edit_seismic.m | 4,719 | utf_8 | 960cbdba8513dec32b6a295c48ff823b | function menu2edit_seismic(figure_handle,axis_handle)
% Create a menu button that allows one to select plot parameters for wiggle plot
% Written by: E. R.: November 20, 2003
% Last updated: September 3, 2004; button legend in red
%
% menu2edit_seismic(figure_handle,axis_handle)
% INPUT
% figure_handle ... |
github | Abakumov/MLIB-master | interpf.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/interpf.m | 2,722 | utf_8 | 4b2f6c5ea8500cae5108876e00df75b4 | function ynew=interpf(yold,dxold,dxnew)
% Function interpolates in the frequency domain;
% appends data to mitigate "edge effects" prior to FFT, and removes them afterwards
% assumes that "dxold" is integer multiple of "dxnew" or vice versa
% Written by: E. Rietsch: February 14, 2001
% Last updated: February 24, ... |
github | Abakumov/MLIB-master | mylistdlg.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/mylistdlg.m | 6,623 | utf_8 | 01328284249b1d5992d4f2b218c69058 | function [idx,ok]=mylistdlg(strings,varargin)
% Open a list for interactive selection of items; based on Matlab function
% "listdlg"
%
% Written by: E. Rietsch: August 4, 2003
% Last updated: February 10, 2004: change dimensions of dialog box
%
% [idx,ok]=mylistdlg(strings,varargin)
% INPUT
% strings cell v... |
github | Abakumov/MLIB-master | gg_pickbox.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/gg_pickbox.m | 2,104 | utf_8 | a95234c4b56d2bad63895bc1379180dd | function pos=gg_pickbox(axis_handle)
% Function to draw a rubberband line and return the start and end points
%
% pos=gg_pickbox(axis_handle)
% INPUT
% axis_handle handle of current axes
% field field in userdata in whoch to store the rectangle coordinates
if nargin == 0
axis_handle=gca;
end
figure... |
github | Abakumov/MLIB-master | figure_export_menu.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/figure_export_menu.m | 3,867 | utf_8 | c2bee1c0758987651931370375975ea7 | function menu_handle=figure_export_menu(figure_handle)
% Creates a menu button on the figure with handle "figure_handle" (or
% the current figure) that allows one to save the figure as a "emf" (Enhanced
% Windows Meta File) for PowerPoint or "eps" (Encapsulated PostScript) for
% LaTeX, or as a JPEG file; does noth... |
github | Abakumov/MLIB-master | assign_input.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/assign_input.m | 4,666 | utf_8 | 8229f64e41f3b662d7ce0c878a564f25 | function param=assign_input(param,arguments,fcn)
% Input argument "arguments" is a cell array; each cell contains a cell array
% whose first entry is a string representing a keyword; the other entries
% represent parameters.
% This function matches these keywords to fields of the structure "param" and
% replaces the... |
github | Abakumov/MLIB-master | create_help_button.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/create_help_button.m | 1,516 | utf_8 | 9f8121e3569b3562d0a82507d0ed7bd5 | function create_help_button(funct)
% Create a menu button that displays instructions found in a text file
% with name ['help4',funct,'.txt'] in subdirectory "HelpFiles" in
% directory S4M.mymatlab
%
% Written by: E. Rietsch: December 16, 2005
% Last updated:
%
% create_help_button(funct)
% INPUT
% f... |
github | Abakumov/MLIB-master | open_segy_file4reading.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/private/open_segy_file4reading.m | 25,438 | utf_8 | 7242f0726c26ff4ac62f472821af34b4 | function [fid,seismic,param,parameters,text_header,binary_header] = ...
open_segy_file4reading(filename,varargin)
% Function opens an SEG-Y file, reads the textual header and the binary file
% header and outputs the file ID, a preliminary seismic data structure
% with empty fields "head... |
github | Abakumov/MLIB-master | moperation.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/@struct/moperation.m | 11,298 | utf_8 | 54b781cd586b9f66f1c73265482cf1f6 | function ds=moperation(i1,i2,operator)
% Function multiplies a constant or matrix elementwise with traces
% of a seismic dataset
%
% Written by: E. Rietsch: December 7, 2006
% Last updated:
%
% ds=moperation(i1,i2,operator)
% INPUT
% i1 first operand
% i2 second operand
% At least one of... |
github | Abakumov/MLIB-master | uoperation.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Geophysics_3.0/@struct/uoperation.m | 2,202 | utf_8 | 02037835badbe268b7a2e07f3b9a1b92 | function ds=uoperation(ds,operator)
% Function performs a unary operation on a dataset
%
% Written by: E. Rietsch: December 7, 2006
% Last updated:
%
% ds=uoperation(i1,operator)
% INPUT
% i1 operand
% At least one of the two operands is a dataset.
% operator string defining operation to ... |
github | Abakumov/MLIB-master | showcell.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Other/showcell.m | 15,711 | utf_8 | 7cf9c7a0321ab88200801279b1c0b63a | function showcell(varargin)
%SHOWCELL Displays cell array with long strings in the command window.
% SHOWCELL(A) displays the contents of a cell array A in the command
% window. It will format the display so that long strings will display
% appropriately. A can be a cell array of numbers, strings, and/or ... |
github | Abakumov/MLIB-master | advexpfig.m | .m | MLIB-master/OTHER/SeisLab_10.0301/S4M/Other/advexpfig.m | 7,202 | utf_8 | 308b54048af84e282ec73b1536c774ab | function [result,msg] = advexpfig(fh,fName,format,varargin)
% ADVEXPFIG Exports a figure into a file (all internal formats are
% supported as well as some formats generated indirectly using an
% intermediary eps format.
%
% [result,msg] = ADVAXPFIG(fh,fName,format,varargin)
% Creates an output from the fi... |
github | Abakumov/MLIB-master | FSM2DVTI.m | .m | MLIB-master/FSM/FSM2DVTI.m | 13,546 | utf_8 | f050076dbf1ed753cb28fd6f7eab8983 | %% Main function
function out = FSM2DVTI(G, S, alpha, betta, gamma, delta, epsilon)
% Find minimum values
alpmin = min(min(alpha));
betmin = min(min(betta));
delmin = min(min(delta));
gammin = min(min(gamma));
epsmin = min(min(epsilon));
% Definition of elastic parameters
[Gnx, Gnz] = size(alpha);
A33 =... |
github | xqmoo8/operating-cost-optimization-master | cost_optimization_for_test_benders.m | .m | operating-cost-optimization-master/cost_optimization_for_test_benders.m | 83,862 | utf_8 | 95fea231af6064af6071a7da4b4035ec | %% the main struture of benders decomposition algorithm
function [cost_for_comparison, final_consumed_time, dual_gap, reduced_distance, infeasible_flag_out] ...
= cost_optimization_for_test_benders( time_slot, voya_distance, accelerate_flag_input, near_opt_optimal_input, operation_mode_input, No_case_in, para_... |
github | uoguelph-mlrg/vlr-master | batchnii2mat.m | .m | vlr-master/utils/batchnii2mat.m | 3,745 | utf_8 | 8b7144b3a54803b964b03e7b897b0aef | % BATCHNII2MAT
% This function loads .nii and .nii.gz image files (from IMG/NII)
% and saves them to .mat files (in IMG/MAT/).
% This function is poorly written for one-time use.
function [] = batchnii2mat()
% warning('off','MATLAB:MKDIR:DirectoryExists');
for i = 1:129
fmt2mat(fmtdef,i);
end
warning('on','MATLAB:MK... |
github | uoguelph-mlrg/vlr-master | tmpname.m | .m | vlr-master/utils/tmpname.m | 508 | utf_8 | 04ce6709ec40dd0a8efa9a3ad9c38b1a | % TMPNAME
% This function generates a string for a temporary file name using concatenated
% varargin arguments. Numbers are converted to '%03.f' format.
function [matname] = tmpname(sub,varargin)
droot = fullfile(pwd);
tmpdir = fullfile(droot,'data','tmp');
if ~exist(tmpdir,'dir')
mkdir(tmpdir);
end
tmpstr = fullfi... |
github | uoguelph-mlrg/vlr-master | fileready.m | .m | vlr-master/utils/fileready.m | 242 | utf_8 | 4a7ebb0248b4384db642ae79f672a549 | % FILEREADY
% Make sure file fname exists and has not been modified in last [delay] ms
function [ready] = fileready(fname,delay)
if nargin < 2, delay = 1000; end
f = dir(fname);
ready = ~isempty(f) && (1000*60*60*24*(now-f.datenum) > delay);
|
github | uoguelph-mlrg/vlr-master | matx.m | .m | vlr-master/utils/matx.m | 920 | utf_8 | cf454e8c3f6050778eeb00362c55e9cd | % MATX
% This function spawns an external MATLAB instance to run in the background
% The code specified in codestr is executed by the spawn.
% Spawns close when complete, but this function does not wait for this.
% Arguments to spawsn *must* be passed via .mat file save/load.
function [cmdstr] = matx(codestr)
if nargi... |
github | uoguelph-mlrg/vlr-master | kfcvidx.m | .m | vlr-master/utils/mri/kfcvidx.m | 1,763 | utf_8 | 171feb325addae90a4ac2f60b6f4fd82 | function [idx] = kfcvidx(h,dofig)
if nargin < 2
dofig = 0;
end
[idx,P] = kfcvexpected(h.scan.N);
if dofig
makefig(h,P,idx);
end
function [idx,P] = kfcvexpected(N)
% logical: used
for n = 1:numel(N)
used{n} = false(1,N(n));
end
NN = numel(N);
idx = cell(1,NN);
CN = cumsum([0,N]);
P = N'*N./sum(N);
PW = floor... |
github | uoguelph-mlrg/vlr-master | scanparams.m | .m | vlr-master/utils/mri/scanparams.m | 1,525 | utf_8 | a870dcb77cad24d6142656f56a0d0077 | % SCANPARAMS
% Returns for a scanner index \in [1,10]:
% the name, imgname slug, number of images, voxel size,
% FLAIR scan paramters, and the simulated graylevels: GM, WM, CSF, WMH
function [name,short,N,x,tERI,Y4] = scanparams(i)
switch i
case 1, name = 'WMH 2017 (1)'; short = 'h17'; N = 20; x = [0.96,0.96,3.00]... |
github | uoguelph-mlrg/vlr-master | simflair.m | .m | vlr-master/utils/mri/simflair.m | 1,884 | utf_8 | 46ac5cb3b6b5b283c445986cf1cc00c0 | function [flair,y,tpm] = simflair(TERI,norm,mri)
if nargin < 1
error('Must specify the TE/TR/TI in TERI.');
end
if nargin < 2
norm = 'wm';
end
if nargin < 3
mri = 'ir';
end
[tpm,M] = gettpm(3);
[y] = getintensities(TERI(1),TERI(2),TERI(3),mri);
flair = zeros(size(M));
for c = 1:size(tpm,4)
flair = flair + tpm(:... |
github | uoguelph-mlrg/vlr-master | imgname.m | .m | vlr-master/utils/mri/imgname/imgname.m | 10,315 | utf_8 | 808dc1b3cb36d4614cda7f224dbe04d3 | % IMGNAME
% This function is a database of names of saved images. The arguments are:
% key -- format 'setkey:imgkey', where
% setkey -- one of: h17, m16, i15, m08, cain, mni
% corresponding to these different datasets (see comments below)
% note: mni is all the other images in MNI spa... |
github | uoguelph-mlrg/vlr-master | imglutname.m | .m | vlr-master/utils/mri/imgname/imglutname.m | 967 | utf_8 | 9689164e6026aa43961081e257290e5a | % IMGLUTNAME
% This function is a wrapper for imgname,
% where the index of an image in a multi-source set can be used
% instead of the image index from its original set
% e.g. 1:96 instead of 1:20, 1:20, 1:20, 1:5, 1:5, 1:5, 1:21
% The specific multi-source set must be indexed in a lut-#.txt file (# = h.Ni)
function ... |
github | uoguelph-mlrg/vlr-master | tightsubs.m | .m | vlr-master/utils/fig/tightsubs.m | 1,162 | utf_8 | a06d300b27ee6d3e4dd3ec268f800a3a | % TIGHTSUBS is a function for flexible fine tune control over subplot spacing.
%
% Inputs:
% nx, ny - the number of plots in x and y directions, respectively.
%
% ax - handles to existing subplots for spacing.
%
% pad - the padding around each axis relative to the total figure size.
% (3 ... |
github | uoguelph-mlrg/vlr-master | vcolorbar.m | .m | vlr-master/utils/fig/color/vcolorbar.m | 463 | utf_8 | a3c4ec50886f45840ea12ba5c5d2d9c5 | % VCOLORBAR
% Create a vertical colorbar size [80,600]
% with ticks specified, and colormap cmap
function [ax] = vcolorbar(ctick,cmap)
N = size(cmap,1);
C = linspace(1,N,N);
figure;
imagesc(imrotate(cat(3,cmap(C,1)',cmap(C,2)',cmap(C,3)'),90));
ax = gca;
ctick = rot90(ctick);
set(ax,'xtick',[],'fontsize',22,...
'yti... |
github | uoguelph-mlrg/vlr-master | hcolorbar.m | .m | vlr-master/utils/fig/color/hcolorbar.m | 399 | utf_8 | fac2291f93788e40c3873f921182e695 | % HCOLORBAR
% Create a horizontal colorbar size [600,80]
% with ticks specified, and colormap cmap
function [ax] = hcolorbar(ctick,cmap)
N = size(cmap,1);
C = linspace(1,N,N);
figure;
imagesc(cat(3,cmap(C,1)',cmap(C,2)',cmap(C,3)'));
ax = gca;
set(ax,'ytick',[],'xtick',linspace(1,N,numel(ctick)),'xticklabel',ctick,'fo... |
github | uoguelph-mlrg/vlr-master | monomap.m | .m | vlr-master/utils/fig/color/colormaps/monomap.m | 557 | utf_8 | dbcf6216bb35f8acd9eb37bebbf3f15c | % MONOMAP
% creates a colormap using the colour clr as a base
% clr - base colour
% m - number of levels
% mm - 2 element specifying darken/lighten levels as the limits:
% negatives: darken by factor |mm(i)|
% positives: lighten by factor |mm(i)|
function [cmap] = monomap(clr,m,mm)
if nargin < 2, m = ... |
github | uoguelph-mlrg/vlr-master | darken.m | .m | vlr-master/utils/fig/color/colormaps/darken.m | 96 | utf_8 | 02241be065df39bb8cb5af8cbf8fef36 | % DARKEN
% darken the clr by factor f \in [0,1]
function [clr] = darken(clr,f)
clr = clr.*(1-f); |
github | uoguelph-mlrg/vlr-master | lighten.m | .m | vlr-master/utils/fig/color/colormaps/lighten.m | 107 | utf_8 | f4f1d723fe4037627413d3a2dabbacc5 | % LIGHTEN
% lighten the clr by factor f \in [0,1]
function [clr] = lighten(clr,f)
clr = 1-((1-clr).*(1-f)); |
github | uoguelph-mlrg/vlr-master | timshow.m | .m | vlr-master/utils/fig/show/timshow.m | 6,124 | utf_8 | 78307c95d0bff35be7bfaecebbdbb4dd | % TIMSHOW is a flexible function for displaying multiple images tightly on the
% same figure. Padding between images, grid dimensions, contrast scale,
% and colourmaps can be specified. Attributes apply to all images. Best
% results with same sized images. Grayscale or colour images.
%
% Input... |
github | uoguelph-mlrg/vlr-master | sliceshow.m | .m | vlr-master/utils/fig/show/sliceshow.m | 465 | utf_8 | 2eab54a16244c2d7bcaf767f469d4ece | % SLICESHOW
% Show slices of a volume I at the indices z
% using timshow, with varargin{:} passed directly to timshow
function [ax] = sliceshow(I,z,varargin)
N = numel(z);
mm = [min(I(:)),max(I(:))];
for i = 1:N
S{i} = squeeze(I(:,:,z(i),:));
end
numstr = num2str(N,'%dx1');
ax = timshow(S{:},numstr,mm,varargin{:});
... |
github | uoguelph-mlrg/vlr-master | volshow.m | .m | vlr-master/utils/fig/show/volshow.m | 13,242 | utf_8 | 1d25d4374727aece1ef4a5b1862e4a3e | % VOLSHOW is a flexible tool for displaying multiple image volumes quickly
% on the same figure. Mouse scroll wheel scrolls the z (3rd) dimension.
% Padding between images, grid dimensions, contrast scale, and
% colourmaps can be specified. Attributes apply to all images. Best
% results ... |
github | uoguelph-mlrg/vlr-master | im2rgb.m | .m | vlr-master/utils/fig/show/im2rgb.m | 477 | utf_8 | 9d49418d48b6c13033964d67802561d8 | % IM2RGB
% This function converts an image (2D or 3D) from grayscale to color using the
% specified colormap.
% Dependencies: biny
function [RGB] = im2rgb(I,map,varargin)
% get the size of the colormap
M = size(map,1);
% bin the image data
if isempty(varargin), varargin{1} = []; end
IU = biny(I,varargin{:},[1,M],M);
%... |
github | uoguelph-mlrg/vlr-master | boxplotn.m | .m | vlr-master/utils/fig/plot/boxplotn.m | 746 | utf_8 | 2c7b93ad6a0c8cbe8cfc4c01f03903af | % BOXPLOTN
% Box plot with coloured grouping.
% X is a cell array. size: [bins, groups]
% cmap must have size [groups,3]
% blabs must be a cell array of bins labels
function boxplotn(X0,cmap,blabs,varargin)
NB = size(X0,1);
NC = size(X0,2);
X = []; G = []; C = [];
for b = 1:NB
for c = 1:NC
Xi = X0{b,c}(:);
X... |
github | uoguelph-mlrg/vlr-master | readnii.m | .m | vlr-master/utils/nii/readnii.m | 529 | utf_8 | b5351779fcf96b8ab4d76d2eb269a48d | % READNII
% read a .nii file: image data and voxel size (optional)
function [I,vsize] = readnii(fname)
[~,~,ftype] = fileparts(fname);
if ~exist(fname,'file')
error('Cannot find NIFTI file: %s',fname);
elseif ~any(strcmp(ftype,{'.nii','.gz'}))
error('File: %s is not NIFTI',fname);
end
try
NII = load_untouch_nii(... |
github | uoguelph-mlrg/vlr-master | readniivsize.m | .m | vlr-master/utils/nii/readniivsize.m | 466 | utf_8 | f85c2453d694ad9cb6696cdd2ba98aa8 | % READNIIVSIZE
% Read just the voxel size from a .nii file
function [vsize] = readniivsize(fname)
[~,~,ftype] = fileparts(fname);
if ~exist(fname,'file')
error('Cannot find NIFTI file: %s',fname);
elseif ~any(strcmp(ftype,{'.nii','.gz'}))
error('File: %s is not NIFTI',fname);
end
try
hdr = load_untouch_header_on... |
github | uoguelph-mlrg/vlr-master | readnicenii.m | .m | vlr-master/utils/nii/readnicenii.m | 489 | utf_8 | 83cabdf6577158e4a2f795720ea61bff | % READNICENII
% Read a .nii file and immediately apply some basic pre-processing.
% M is a brain mask (must be same size as I)
% mm is a 2 element vector denoting the quantiles (0-1) for clipping the data
% and rescaling to the range [0,1]
function [I,x] = readnicenii(fname,M,mm)
if nargin == 2, e = 0.0001; mm = [e,1-... |
github | uoguelph-mlrg/vlr-master | writenii.m | .m | vlr-master/utils/nii/writenii.m | 1,537 | utf_8 | 734479ada17064250e0110215778bf96 | % WRITENII
% Write an image to .nii format using a template .nii file for the header
% I - the image volume data
% fname - the new .nii file name
% niiname - the template .nii file name
% datatype - I don't think this actually works
function [] = writenii(I,fname,niiname,datatype)
if nargin == 3
datatype = class(I);... |
github | uoguelph-mlrg/vlr-master | load_nii_ext.m | .m | vlr-master/utils/nii/nifti_DL/load_nii_ext.m | 5,337 | utf_8 | fa0e831b0a596c3208b21bddc1c6d812 | % Load NIFTI header extension after its header is loaded using load_nii_hdr.
%
% Usage: ext = load_nii_ext(filename)
%
% filename - NIFTI file name.
%
% Returned values:
%
% ext - Structure of NIFTI header extension, which includes num_ext,
% and all the extended header sections in the header extension.
% ... |
github | uoguelph-mlrg/vlr-master | rri_orient.m | .m | vlr-master/utils/nii/nifti_DL/rri_orient.m | 2,251 | utf_8 | 4253fb96b9189a8a4bad49661d9ecac3 | % Convert image of different orientations to standard Analyze orientation
%
% Usage: nii = rri_orient(nii);
% Jimmy Shen (jimmy@rotman-baycrest.on.ca), 26-APR-04
%___________________________________________________________________
function [nii, orient, pattern] = rri_orient(nii, varargin)
if nargin > 1
... |
github | uoguelph-mlrg/vlr-master | save_untouch0_nii_hdr.m | .m | vlr-master/utils/nii/nifti_DL/save_untouch0_nii_hdr.m | 8,594 | utf_8 | 7e8b1b327e1924837820f75780d52d01 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function save_nii_hdr(hdr, fid)
if ~isequal(hdr.hk.sizeof_hdr,348),
error('hdr.hk.sizeof_hdr must be 348.');
end
write_header(hdr, fid);
return; % save_nii_hdr
%---------------------------------------------------------------... |
github | uoguelph-mlrg/vlr-master | rri_zoom_menu.m | .m | vlr-master/utils/nii/nifti_DL/rri_zoom_menu.m | 737 | utf_8 | d8151523470b0fba970eb1d98ba56030 | % Imbed a zoom menu to any figure.
%
% Usage: rri_zoom_menu(fig);
%
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
%
%--------------------------------------------------------------------
function menu_hdl = rri_zoom_menu(fig)
if isnumeric(fig)
menu_hdl = uimenu('Parent',fig, ...
'Label','Zoom on', ..... |
github | uoguelph-mlrg/vlr-master | rri_select_file.m | .m | vlr-master/utils/nii/nifti_DL/rri_select_file.m | 16,599 | utf_8 | e349954ca803370f62ceeabdbab5912e | function [selected_file, selected_path] = rri_select_file(varargin)
%
% USAGE: [selected_file, selected_path] = ...
% rri_select_file(dir_name, fig_title)
%
% Allow user to select a file from a list of Matlab competible
% file format
%
% Example:
%
% [selected_file, selected_path] = ...
% rri_select_... |
github | uoguelph-mlrg/vlr-master | clip_nii.m | .m | vlr-master/utils/nii/nifti_DL/clip_nii.m | 3,306 | utf_8 | a70bdbed5a0813312d4c83f94b99a710 | % CLIP_NII: Clip the NIfTI volume from any of the 6 sides
%
% Usage: nii = clip_nii(nii, [option])
%
% Inputs:
%
% nii - NIfTI volume.
%
% option - struct instructing how many voxel to be cut from which side.
%
% option.cut_from_L = ( number of voxel )
% option.cut_from_R = ( number of voxel )
% option.cut_from_P ... |
github | uoguelph-mlrg/vlr-master | affine.m | .m | vlr-master/utils/nii/nifti_DL/affine.m | 16,110 | utf_8 | 768d2303e551a9584685bdb01abf6f8b | % Using 2D or 3D affine matrix to rotate, translate, scale, reflect and
% shear a 2D image or 3D volume. 2D image is represented by a 2D matrix,
% 3D volume is represented by a 3D matrix, and data type can be real
% integer or floating-point.
%
% You may notice that MATLAB has a function called 'imtransform.m' fo... |
github | uoguelph-mlrg/vlr-master | load_untouch_nii_img.m | .m | vlr-master/utils/nii/nifti_DL/load_untouch_nii_img.m | 14,756 | utf_8 | 688b2a42f8071c6402a037c7ca923689 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function [img,hdr] = load_untouch_nii_img(hdr,filetype,fileprefix,machine,img_idx,dim5_idx,dim6_idx,dim7_idx,old_RGB,slice_idx)
if ~exist('hdr','var') | ~exist('filetype','var') | ~exist('fileprefix','var') | ~exist('machine','var')
error('U... |
github | uoguelph-mlrg/vlr-master | load_untouch_nii.m | .m | vlr-master/utils/nii/nifti_DL/load_untouch_nii.m | 6,182 | utf_8 | 93108a725d2e357d773c8aa0acf71328 | % Load NIFTI or ANALYZE dataset, but not applying any appropriate affine
% geometric transform or voxel intensity scaling.
%
% Although according to NIFTI website, all those header information are
% supposed to be applied to the loaded NIFTI image, there are some
% situations that people do want to leave the origi... |
github | uoguelph-mlrg/vlr-master | collapse_nii_scan.m | .m | vlr-master/utils/nii/nifti_DL/collapse_nii_scan.m | 6,778 | utf_8 | 64b1cb0f7cd9e095d3c11ca66453df69 | % Collapse multiple single-scan NIFTI files into a multiple-scan NIFTI file
%
% Usage: collapse_nii_scan(scan_file_pattern, [collapsed_fileprefix], [scan_file_folder])
%
% Here, scan_file_pattern should look like: 'myscan_0*.img'
% If collapsed_fileprefix is omit, 'multi_scan' will be used
% If scan_file_folder is... |
github | uoguelph-mlrg/vlr-master | rri_orient_ui.m | .m | vlr-master/utils/nii/nifti_DL/rri_orient_ui.m | 5,384 | utf_8 | e1196b81940d9f93fbdb43c33799e587 | % Return orientation of the current image:
% orient is orientation 1x3 matrix, in that:
% Three elements represent: [x y z]
% Element value: 1 - Left to Right; 2 - Posterior to Anterior;
% 3 - Inferior to Superior; 4 - Right to Left;
% 5 - Anterior to Posterior; 6 - Superior to Inferior;
% e.g.:
% Standard RAS Or... |
github | uoguelph-mlrg/vlr-master | load_untouch0_nii_hdr.m | .m | vlr-master/utils/nii/nifti_DL/load_untouch0_nii_hdr.m | 8,093 | utf_8 | 3de9ff6a1da47b56ae680e7660eaa041 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function hdr = load_nii_hdr(fileprefix, machine)
fn = sprintf('%s.hdr',fileprefix);
fid = fopen(fn,'r',machine);
if fid < 0,
msg = sprintf('Cannot open file %s.',fn);
error(msg);
else
fseek(fid,0,'bof');
hdr =... |
github | uoguelph-mlrg/vlr-master | load_nii.m | .m | vlr-master/utils/nii/nifti_DL/load_nii.m | 6,808 | utf_8 | d098a5dbea3cd4ad76cea624ffbef9db | % Load NIFTI or ANALYZE dataset. Support both *.nii and *.hdr/*.img
% file extension. If file extension is not provided, *.hdr/*.img will
% be used as default.
%
% A subset of NIFTI transform is included. For non-orthogonal rotation,
% shearing etc., please use 'reslice_nii.m' to reslice the NIFTI file.
% It will... |
github | uoguelph-mlrg/vlr-master | unxform_nii.m | .m | vlr-master/utils/nii/nifti_DL/unxform_nii.m | 1,181 | utf_8 | a77d113be34b09d588b2eb326a3c65c8 | % Undo the flipping and rotations performed by xform_nii; spit back only
% the raw img data block. Initial cut will only deal with 3D volumes
% strongly assume we have called xform_nii to write down the steps used
% in xform_nii.
%
% Usage: a = load_nii('original_name');
% manipulate a.img to make array... |
github | uoguelph-mlrg/vlr-master | load_untouch_nii_hdr.m | .m | vlr-master/utils/nii/nifti_DL/load_untouch_nii_hdr.m | 8,522 | utf_8 | 2d4bc8c8ffb83b37daf1e8dd87c108e6 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function hdr = load_nii_hdr(fileprefix, machine, filetype)
if filetype == 2
fn = sprintf('%s.nii',fileprefix);
if ~exist(fn)
msg = sprintf('Cannot find file "%s.nii".', fileprefix);
error(msg);
end
else
... |
github | uoguelph-mlrg/vlr-master | save_nii_ext.m | .m | vlr-master/utils/nii/nifti_DL/save_nii_ext.m | 977 | utf_8 | b60a98ab7537a883dc3ffef3175f19ae | % Save NIFTI header extension.
%
% Usage: save_nii_ext(ext, fid)
%
% ext - struct with NIFTI header extension fields.
%
% NIFTI data format can be found on: http://nifti.nimh.nih.gov
%
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
%
function save_nii_ext(ext, fid)
if ~exist('ext','var') | ~exist('fid','var')
... |
github | uoguelph-mlrg/vlr-master | view_nii_menu.m | .m | vlr-master/utils/nii/nifti_DL/view_nii_menu.m | 14,415 | utf_8 | 32dd591fa1070721f0255f47f6e02510 | % Imbed Zoom, Interp, and Info menu to view_nii window.
%
% Usage: view_nii_menu(fig);
%
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
%
%--------------------------------------------------------------------
function menu_hdl = view_nii_menu(fig, varargin)
if isnumeric(fig)
menu_hdl = init(fig);
retur... |
github | uoguelph-mlrg/vlr-master | save_untouch_header_only.m | .m | vlr-master/utils/nii/nifti_DL/save_untouch_header_only.m | 2,132 | utf_8 | 5f0515ef6a35f171bc8371d0f3fd365d | % This function is only used to save Analyze or NIfTI header that is
% ended with .hdr and loaded by load_untouch_header_only.m. If you
% have NIfTI file that is ended with .nii and you want to change its
% header only, you can use load_untouch_nii / save_untouch_nii pair.
%
% Usage: save_untouch_header_only(hd... |
github | uoguelph-mlrg/vlr-master | pad_nii.m | .m | vlr-master/utils/nii/nifti_DL/pad_nii.m | 3,712 | utf_8 | 0b9de8feba6840e2d8ea1ab1752747c7 | % PAD_NII: Pad the NIfTI volume from any of the 6 sides
%
% Usage: nii = pad_nii(nii, [option])
%
% Inputs:
%
% nii - NIfTI volume.
%
% option - struct instructing how many voxel to be padded from which side.
%
% option.pad_from_L = ( number of voxel )
% option.pad_from_R = ( number of voxel )
% option.pad_from_P ... |
github | uoguelph-mlrg/vlr-master | load_nii_hdr.m | .m | vlr-master/utils/nii/nifti_DL/load_nii_hdr.m | 10,031 | utf_8 | e95839e314863f7ee463cc2626dd447c | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function [hdr, filetype, fileprefix, machine] = load_nii_hdr(fileprefix)
if ~exist('fileprefix','var'),
error('Usage: [hdr, filetype, fileprefix, machine] = load_nii_hdr(filename)');
end
machine = 'ieee-le';
new_ext = 0;
if fin... |
github | uoguelph-mlrg/vlr-master | save_untouch_slice.m | .m | vlr-master/utils/nii/nifti_DL/save_untouch_slice.m | 19,683 | utf_8 | 364468e5dbd3790c1aadf9a768534f1f | % Save back to the original image with a portion of slices that was
% loaded by "load_untouch_nii". You can process those slices matrix
% in any way, as long as their dimension is not altered.
%
% Usage: save_untouch_slice(slice, filename, ...
% slice_idx, [img_idx], [dim5_idx], [dim6_idx], [dim7_idx])
%
% slice ... |
github | uoguelph-mlrg/vlr-master | load_nii_img.m | .m | vlr-master/utils/nii/nifti_DL/load_nii_img.m | 12,328 | utf_8 | b1b9dd2838a8f217b10fefdc8a931d5e | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function [img,hdr] = load_nii_img(hdr,filetype,fileprefix,machine,img_idx,dim5_idx,dim6_idx,dim7_idx,old_RGB)
if ~exist('hdr','var') | ~exist('filetype','var') | ~exist('fileprefix','var') | ~exist('machine','var')
error('Usage: [img,hdr] = ... |
github | uoguelph-mlrg/vlr-master | bresenham_line3d.m | .m | vlr-master/utils/nii/nifti_DL/bresenham_line3d.m | 4,493 | utf_8 | c19f06df423676afeb59762ac55c0c2f | % Generate X Y Z coordinates of a 3D Bresenham's line between
% two given points.
%
% A very useful application of this algorithm can be found in the
% implementation of Fischer's Bresenham interpolation method in my
% another program that can rotate three dimensional image volume
% with an affine matrix:
% http... |
github | uoguelph-mlrg/vlr-master | make_nii.m | .m | vlr-master/utils/nii/nifti_DL/make_nii.m | 6,849 | utf_8 | 3c7c8b81655c111a9ce4b82086bde4f5 | % Make NIfTI structure specified by an N-D matrix. Usually, N is 3 for
% 3D matrix [x y z], or 4 for 4D matrix with time series [x y z t].
% Optional parameters can also be included, such as: voxel_size,
% origin, datatype, and description.
%
% Once the NIfTI structure is made, it can be saved into NIfTI fil... |
github | uoguelph-mlrg/vlr-master | verify_nii_ext.m | .m | vlr-master/utils/nii/nifti_DL/verify_nii_ext.m | 1,676 | utf_8 | db3d32ecba688905185f5ed01b409fd1 | % Verify NIFTI header extension to make sure that each extension section
% must be an integer multiple of 16 byte long that includes the first 8
% bytes of esize and ecode. If the length of extension section is not the
% above mentioned case, edata should be padded with all 0.
%
% Usage: [ext, esize_total] = verif... |
github | uoguelph-mlrg/vlr-master | get_nii_frame.m | .m | vlr-master/utils/nii/nifti_DL/get_nii_frame.m | 4,333 | utf_8 | 8b0cba9d07733a6f82753b0c40b51107 | % Return time frame of a NIFTI dataset. Support both *.nii and
% *.hdr/*.img file extension. If file extension is not provided,
% *.hdr/*.img will be used as default.
%
% It is a lightweighted "load_nii_hdr", and is equivalent to
% hdr.dime.dim(5)
%
% Usage: [ total_scan ] = get_nii_frame(filename)
%
% filen... |
github | uoguelph-mlrg/vlr-master | flip_lr.m | .m | vlr-master/utils/nii/nifti_DL/flip_lr.m | 3,484 | utf_8 | a0b2d0189d90339a841863efeb60681a | % When you load any ANALYZE or NIfTI file with 'load_nii.m', and view
% it with 'view_nii.m', you may find that the image is L-R flipped.
% This is because of the confusion of radiological and neurological
% convention in the medical image before NIfTI format is adopted. You
% can find more details from:
%
% http... |
github | uoguelph-mlrg/vlr-master | save_nii.m | .m | vlr-master/utils/nii/nifti_DL/save_nii.m | 9,404 | utf_8 | 88aa93174482539fe993ac335fb01541 | % Save NIFTI dataset. Support both *.nii and *.hdr/*.img file extension.
% If file extension is not provided, *.hdr/*.img will be used as default.
%
% Usage: save_nii(nii, filename, [old_RGB])
%
% nii.hdr - struct with NIFTI header fields (from load_nii.m or make_nii.m)
%
% nii.img - 3D (or 4D) matrix of NIFTI... |
github | uoguelph-mlrg/vlr-master | rri_file_menu.m | .m | vlr-master/utils/nii/nifti_DL/rri_file_menu.m | 3,974 | utf_8 | 1ec91620ceb4108dde9a63945380028f | % Imbed a file menu to any figure. If file menu exist, it will append
% to the existing file menu. This file menu includes: Copy to clipboard,
% print, save, close etc.
%
% Usage: rri_file_menu(fig);
%
% rri_file_menu(fig,0) means no 'Close' menu.
%
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
%
%---------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.