This MAT LAB program analyzes patient quality assurance data from the DAVID Patient Quality Assurance software. It reads patient data files, analyzes the data for each beam, session and segment, and generates output files and plots showing any warnings or alarms where the measured values exceed thresholds compared to the reference values. Key functions include reading and validating the patient files, analyzing the data, writing output files, and plotting the results.
Nonlinear analysis of braced frame with hinge by hinge method in c programmingSalar Delavar Qashqai
This document is a C program code for nonlinear analysis of braced frames with hinge elements using the hinge method. The program imports input data, calculates the global stiffness matrix and its inverse, determines member forces and displacements through matrix operations, and outputs results to Excel files. Key steps include importing geometry, material properties, and loading, calculating element and system stiffness matrices, inverting the system matrix, determining member forces and displacements, and reporting results.
Geometric nonlinearity analysis of springs with rigid element displacement co...Salar Delavar Qashqai
This document contains the code for analyzing the geometric and material nonlinearity of springs under displacement-controlled loading. The code imports input data on spring properties and stress-strain behavior, performs an incremental analysis to calculate the base shear and displacement at each step, and exports the results to Excel and MATLAB files. Negative or invalid input values trigger error messages. The analysis calculates the strain, stiffness, and force in each spring at each increment until the ultimate displacement is reached.
What are the great predictors of future performance and how to recruit for th...LinkedIn Talent Solutions
Nell Thayer Heisner, Fuze
Eric Trickett, TripAdvisor
Mike Hebert, edX
Sarah Lawless, Moderator, LinkedIn
Have you ever thought about how a company's core values impact hiring? In this session we will discuss how a candidate's attributes/characteristics/experiences are predictors of future performance and how to align them to core values.
Session highlights:
Why your company's core values are the link to anticipating and promoting employee performance.
How your recruiting team can quickly go from a basic interview to an elevated, value-centric interview.
Metrics and what the future looks like for recruiter performance evaluations.
Check out the best of Talent Connect: http://bit.ly/2e5ojNe
VIDEO SNIMAK PREDAVANJA MOŽETE POGLEDATI NA KRAJU PISANE PREZENTACIJE.
Kriza je neplanirani i neželjeni proces koji traje određeno vreme, a na koji je moguće samo delimično uticati, tako da se može završiti na razne načine. Obično se završi NEOČEKIVANO LOŠIM PUBLICITETOM... ako ne preduzmete mere krizne komunikacije.
Kako se komunikacija najbrže odvija na internetu - ovo je podsetnik šta raditi u slučaju krize, a šta ne raditi. Dobre vesti šire se brzo, loše vesti šire se još brže, a vesti na webu NAJBRŽE!
Ukoliko vam treba savet - kontakti su na kraju. :)
Napomena: Ova tema je tema predavanja u okviru pro-bono projekta "Poklanjam znanje" o kom možete više saznati na http://www.slideshare.net/Lavche/projekat-poklanjam-znanje
Nonlinear analysis of braced frame with hinge by hinge method in c programmingSalar Delavar Qashqai
This document is a C program code for nonlinear analysis of braced frames with hinge elements using the hinge method. The program imports input data, calculates the global stiffness matrix and its inverse, determines member forces and displacements through matrix operations, and outputs results to Excel files. Key steps include importing geometry, material properties, and loading, calculating element and system stiffness matrices, inverting the system matrix, determining member forces and displacements, and reporting results.
Geometric nonlinearity analysis of springs with rigid element displacement co...Salar Delavar Qashqai
This document contains the code for analyzing the geometric and material nonlinearity of springs under displacement-controlled loading. The code imports input data on spring properties and stress-strain behavior, performs an incremental analysis to calculate the base shear and displacement at each step, and exports the results to Excel and MATLAB files. Negative or invalid input values trigger error messages. The analysis calculates the strain, stiffness, and force in each spring at each increment until the ultimate displacement is reached.
What are the great predictors of future performance and how to recruit for th...LinkedIn Talent Solutions
Nell Thayer Heisner, Fuze
Eric Trickett, TripAdvisor
Mike Hebert, edX
Sarah Lawless, Moderator, LinkedIn
Have you ever thought about how a company's core values impact hiring? In this session we will discuss how a candidate's attributes/characteristics/experiences are predictors of future performance and how to align them to core values.
Session highlights:
Why your company's core values are the link to anticipating and promoting employee performance.
How your recruiting team can quickly go from a basic interview to an elevated, value-centric interview.
Metrics and what the future looks like for recruiter performance evaluations.
Check out the best of Talent Connect: http://bit.ly/2e5ojNe
VIDEO SNIMAK PREDAVANJA MOŽETE POGLEDATI NA KRAJU PISANE PREZENTACIJE.
Kriza je neplanirani i neželjeni proces koji traje određeno vreme, a na koji je moguće samo delimično uticati, tako da se može završiti na razne načine. Obično se završi NEOČEKIVANO LOŠIM PUBLICITETOM... ako ne preduzmete mere krizne komunikacije.
Kako se komunikacija najbrže odvija na internetu - ovo je podsetnik šta raditi u slučaju krize, a šta ne raditi. Dobre vesti šire se brzo, loše vesti šire se još brže, a vesti na webu NAJBRŽE!
Ukoliko vam treba savet - kontakti su na kraju. :)
Napomena: Ova tema je tema predavanja u okviru pro-bono projekta "Poklanjam znanje" o kom možete više saznati na http://www.slideshare.net/Lavche/projekat-poklanjam-znanje
Leonardo played baseball from age 5 to 14 and started bowling when he was 5, which he still enjoys today with a high average and a high game of 299, just missing a perfect 300 game. He believes better things are still to come in the future.
The document summarizes an online marketing audit process that includes:
1) A high-level review of a company's current website and historical analytics to identify key areas of concern.
2) An audit that examines reach, persuasion, conversion, and integration across online and offline marketing strategies.
3) A presentation of audit results and recommendations to implement changes, test improvements, and boost marketing returns.
We are an IT company that specializes in building engaging online communities and platforms. Some of our most popular communities include Gustos.ro, a Romanian culinary website, and TPU.ro, a collaborative content platform. We also developed ZeList.ro, the most important Romanian blog search engine. Our clients include many large Romanian media groups and international brands. We have expertise in video delivery, online advertising, and developing scalable systems to handle high traffic volumes.
El documento expresa la frustración de alguien que no ha podido usar Tuenti en dos días. Cuando finalmente se conecta, nota que Sara está disponible y le escribe, pero Daniel Cano interrumpe la conversación antes de que pueda despedirse.
Originally presented at http://www.eventheroes.ro/
Did you agree with the trends that we included in the presentation? Did we miss any? Please share your thoughts with us at https://twitter.com/Slidoapp.
More info about the future of events: http://www.sli.do/
8 Reasons Twitter Still Lags Behind FacebookMashable
Twitter's public offering this week was the most buzzed-about tech IPO since Facebook's last May. But Twitter has not reached Facebook's level of influence just yet.
In 2013 so far, Facebook's revenue tops $5.3 billion. Twitter, in turn, generated $422 million. When it comes to active monthly users, Facebook's base of almost 1.2 billion trounces Twitter's 232 million.
More details: http://on.mash.to/1feLGdG
Wiki in web 2.0 scenerio concept emerged as a response to the technologies and setting the libraries into more user-centered, networking faculty, students, and librarians to create a vital and evolving organization designed to meet the need of the of the user in digital library era.
Sajid Imtiaz discusses Pakistan's relationship with international organizations and the country's path forward. Pakistan collaborates with organizations like UNDP and USAID on important departments. Some analysts believe recovering $200 billion from Swiss banks could increase per capita income so Pakistan wouldn't need IMF or World Bank loans. However, others want self-sufficiency. True leadership would make Pakistan advanced through technology and welfare, while also requiring cooperation with specialized global organizations and local manufacturing, like of airplanes.
1) In the 1860s, farmers in Natal struggled with labor shortages as Zulu farmers refused to work in the terrible conditions on large commercial farms, particularly sugar farms.
2) As a result, between 1860 and 1911 over 140,000 indentured laborers from India were brought to Natal to work on sugar cane plantations and other industries like railways and mines.
3) These indentured Indians faced extremely difficult working conditions, often working up to 17 hours a day for little or no pay, and faced discrimination, with families sometimes being separated.
Presentation for the Biomag 2016 satellite meeting "From raw MEG to publication - How to perform MEG group analysis with free academic software"
Corresponding MATLAB scripts can be found on https://github.com/fieldtrip/Wakeman-and-Henson-2015
The document discusses various topics related to structures and unions, files, and error handling in C programming. It includes:
1) Defining structures and unions, passing structures to functions, self-referential structures.
2) Opening, reading, writing, and closing files. Functions for file input/output like fopen, fprintf, fscanf, getc, putc.
3) Error handling functions like feof() and ferror() to check for end of file or errors during file operations.
This document contains a summary of code snippets and programs related to learning C programming. It begins by thanking several people for their support and contains quotes about programming. It then presents over a dozen short programs numbered from 1.1 to 3.16 that demonstrate basic C concepts like printing statements, mathematical operations, conditional statements, loops and functions. Each program is accompanied by a brief description and comments.
This document contains 14 chapters with programming examples in C language. Chapter 1 includes basic programs to print name, address and patterns. Chapter 2 covers programs on calculations, loops and conditional statements. Later chapters introduce more advanced concepts like functions, arrays, pointers and file handling. The document serves as a learning guide for beginners to practice and learn basic to intermediate C programming skills.
This document contains programs and algorithms for simulating different CPU scheduling algorithms like FCFS, SJF, Priority and Round Robin. It also contains a program for implementing the Producer-Consumer problem using semaphores and an algorithm for implementing optimal page replacement.
The document discusses functions in C programming. It provides examples of defining functions with parameters and return types, calling functions by passing arguments, using header files to declare functions, and recursion. It shows functions being defined and called to perform tasks like calculating factorials, displaying prices based on hotel rates and nights, and converting numbers to binary. Functions allow breaking programs into smaller, reusable components.
The document contains code snippets demonstrating various programming concepts in C including:
- Hello world program
- Infinite loops using while and for loops
- For and while loops to iterate from 0 to 5
- Increment and decrement operators
- Functions to add two numbers and using pointers
- Conditional operators to check odd/even
- Switch statements
- Checking leap years
- Palindrome, perfect, and factorial numbers using recursion
- Greatest common divisor and least common multiple
- Converting between binary and decimal
- Permutations and combinations using functions
- Pattern matching using loops and variables
The document contains code snippets and questions related to C programming. It includes questions on functions to check birthdays, find syntax errors, count odd divisor numbers, check if a number is prime, swap bits, calculate array sums, find maximum of 3 numbers, rotate linked lists, calculate unlocking keys from locking keys, and insert strings into ternary search trees. Solutions to the questions are also provided as code snippets.
Password protected personal diary reportMoueed Ahmed
The document is a password protected personal diary program code written in C. It includes functions for adding, viewing, editing, and deleting records from the diary. The main function acts as the driver code and displays a menu for the user to select these options. Additional functions handle password validation, reading/writing data to binary files, and performing the necessary operations for each diary record option. Header files like stdio.h, string.h are included for input/output and string handling functionality.
Leonardo played baseball from age 5 to 14 and started bowling when he was 5, which he still enjoys today with a high average and a high game of 299, just missing a perfect 300 game. He believes better things are still to come in the future.
The document summarizes an online marketing audit process that includes:
1) A high-level review of a company's current website and historical analytics to identify key areas of concern.
2) An audit that examines reach, persuasion, conversion, and integration across online and offline marketing strategies.
3) A presentation of audit results and recommendations to implement changes, test improvements, and boost marketing returns.
We are an IT company that specializes in building engaging online communities and platforms. Some of our most popular communities include Gustos.ro, a Romanian culinary website, and TPU.ro, a collaborative content platform. We also developed ZeList.ro, the most important Romanian blog search engine. Our clients include many large Romanian media groups and international brands. We have expertise in video delivery, online advertising, and developing scalable systems to handle high traffic volumes.
El documento expresa la frustración de alguien que no ha podido usar Tuenti en dos días. Cuando finalmente se conecta, nota que Sara está disponible y le escribe, pero Daniel Cano interrumpe la conversación antes de que pueda despedirse.
Originally presented at http://www.eventheroes.ro/
Did you agree with the trends that we included in the presentation? Did we miss any? Please share your thoughts with us at https://twitter.com/Slidoapp.
More info about the future of events: http://www.sli.do/
8 Reasons Twitter Still Lags Behind FacebookMashable
Twitter's public offering this week was the most buzzed-about tech IPO since Facebook's last May. But Twitter has not reached Facebook's level of influence just yet.
In 2013 so far, Facebook's revenue tops $5.3 billion. Twitter, in turn, generated $422 million. When it comes to active monthly users, Facebook's base of almost 1.2 billion trounces Twitter's 232 million.
More details: http://on.mash.to/1feLGdG
Wiki in web 2.0 scenerio concept emerged as a response to the technologies and setting the libraries into more user-centered, networking faculty, students, and librarians to create a vital and evolving organization designed to meet the need of the of the user in digital library era.
Sajid Imtiaz discusses Pakistan's relationship with international organizations and the country's path forward. Pakistan collaborates with organizations like UNDP and USAID on important departments. Some analysts believe recovering $200 billion from Swiss banks could increase per capita income so Pakistan wouldn't need IMF or World Bank loans. However, others want self-sufficiency. True leadership would make Pakistan advanced through technology and welfare, while also requiring cooperation with specialized global organizations and local manufacturing, like of airplanes.
1) In the 1860s, farmers in Natal struggled with labor shortages as Zulu farmers refused to work in the terrible conditions on large commercial farms, particularly sugar farms.
2) As a result, between 1860 and 1911 over 140,000 indentured laborers from India were brought to Natal to work on sugar cane plantations and other industries like railways and mines.
3) These indentured Indians faced extremely difficult working conditions, often working up to 17 hours a day for little or no pay, and faced discrimination, with families sometimes being separated.
Presentation for the Biomag 2016 satellite meeting "From raw MEG to publication - How to perform MEG group analysis with free academic software"
Corresponding MATLAB scripts can be found on https://github.com/fieldtrip/Wakeman-and-Henson-2015
The document discusses various topics related to structures and unions, files, and error handling in C programming. It includes:
1) Defining structures and unions, passing structures to functions, self-referential structures.
2) Opening, reading, writing, and closing files. Functions for file input/output like fopen, fprintf, fscanf, getc, putc.
3) Error handling functions like feof() and ferror() to check for end of file or errors during file operations.
This document contains a summary of code snippets and programs related to learning C programming. It begins by thanking several people for their support and contains quotes about programming. It then presents over a dozen short programs numbered from 1.1 to 3.16 that demonstrate basic C concepts like printing statements, mathematical operations, conditional statements, loops and functions. Each program is accompanied by a brief description and comments.
This document contains 14 chapters with programming examples in C language. Chapter 1 includes basic programs to print name, address and patterns. Chapter 2 covers programs on calculations, loops and conditional statements. Later chapters introduce more advanced concepts like functions, arrays, pointers and file handling. The document serves as a learning guide for beginners to practice and learn basic to intermediate C programming skills.
This document contains programs and algorithms for simulating different CPU scheduling algorithms like FCFS, SJF, Priority and Round Robin. It also contains a program for implementing the Producer-Consumer problem using semaphores and an algorithm for implementing optimal page replacement.
The document discusses functions in C programming. It provides examples of defining functions with parameters and return types, calling functions by passing arguments, using header files to declare functions, and recursion. It shows functions being defined and called to perform tasks like calculating factorials, displaying prices based on hotel rates and nights, and converting numbers to binary. Functions allow breaking programs into smaller, reusable components.
The document contains code snippets demonstrating various programming concepts in C including:
- Hello world program
- Infinite loops using while and for loops
- For and while loops to iterate from 0 to 5
- Increment and decrement operators
- Functions to add two numbers and using pointers
- Conditional operators to check odd/even
- Switch statements
- Checking leap years
- Palindrome, perfect, and factorial numbers using recursion
- Greatest common divisor and least common multiple
- Converting between binary and decimal
- Permutations and combinations using functions
- Pattern matching using loops and variables
The document contains code snippets and questions related to C programming. It includes questions on functions to check birthdays, find syntax errors, count odd divisor numbers, check if a number is prime, swap bits, calculate array sums, find maximum of 3 numbers, rotate linked lists, calculate unlocking keys from locking keys, and insert strings into ternary search trees. Solutions to the questions are also provided as code snippets.
Password protected personal diary reportMoueed Ahmed
The document is a password protected personal diary program code written in C. It includes functions for adding, viewing, editing, and deleting records from the diary. The main function acts as the driver code and displays a menu for the user to select these options. Additional functions handle password validation, reading/writing data to binary files, and performing the necessary operations for each diary record option. Header files like stdio.h, string.h are included for input/output and string handling functionality.
C language concept with code apna college.pdfmhande899
The document discusses various topics related to C language programming including variables, data types, constants, keywords, program structure, comments, input/output, compilation process, and an overview of topics to be covered in a C language tutorial from basic to advanced concepts. Specifically, it provides examples of variable declarations and definitions, basic program structure with main function, different ways to add comments, methods of accepting user input and printing output, and the compilation process to convert C code into executable files.
This document provides C programs to implement various data structures and algorithms. It is divided into two parts. Part A includes programs to find GCD using recursion, generate Pascal's triangle using binomial coefficients, find Fibonacci numbers recursively, implement Towers of Hanoi recursively, find the largest and smallest element in an array, write even and odd numbers to separate files, store student records in a file, and sort city names alphabetically. Part B includes programs to sort arrays using insertion, quick, merge, selection and bubble sort and perform linear and binary searches recursively. It also includes programs to implement stacks, queues, linked lists and binary trees.
The document discusses ways to make applications more resilient to crashes. It suggests using caches instead of master copies to avoid data loss on crashes. Database transactions can maintain consistency even if the database crashes. Atomic operations like file renames can be used to update counts reliably. Recovery is also important - inconsistent states after crashes should be detected and resolved. The document advocates designing systems with crashes in mind through techniques like logging, versioning, and watchdog processes.
This document describes ggTimeSeries, an R package that provides extensions to ggplot2 for creating time series plots. It includes examples of using functions from ggTimeSeries to create calendar heatmaps, horizon graphs, steam graphs, and marimekko plots from time series data. The examples demonstrate how to generate sample time series data, create basic plots, and add formatting customizations.
Using standard libraries like stdio and sdtlib.h and using stats.h a.pdffashiongallery1
Unlike the Federal income tax, most states do not require some form of state income tax.
True
False
Solution
Correct answer is True
Unlike Federal income tax, most states do not require some form of state income tax - This
statement is true as fililng of Fedral income tax return is mandatory for almost everybody but
some US states like Alaska, Florida, Navada, South Dakota, Texas, Washington and Wayoming
do not require filing of state income tax..
To write a program that implements the following C++ concepts 1. Dat.pdfSANDEEPARIHANT
To write a program that implements the following C++ concepts 1. Data Encapsulation 2.
Instantiate classes 3. Composition Class 4. Aggregation Class 5. Dynamic Memory 6. File
Stream Make a program that reads a file and can generate reports. Each file will have phone calls
records (see section 4). The program will process the data gathering all minutes and total amount
for each report. The program should have a menu (see section 1): 1. New Report – this option
will ask a file name (TE??????.tel). This option will instantiate an object of Report class, loading
the whole file into memory. 2. Delete a report – this option will display all reports available in
memory and ask which one you would like to delete. 3. Display a report – this option will
display all reports available in memory and ask you which one you would like to generate a
report. 4. Exit – Program ends. For option 1, you do not know how many reports are, meaning
that you will create dynamically the reports. For long distance calls the formula will be (minutes
call x $1.50). For local phone calls the formula will be (minutes call x $0.25)
--------------------------------------------------------------------------------------------------------------------
----------------------------
//Main.cpp
*#define between(x,y,z) ((x>=y && x<=z)? true:false)
#include
#include
#include
#include \"Data.h\"
#include \"Report.h\"
#include \"Menu.h\"
using namespace std;
//uses class Report to create reports
//uses class Menu to display a menu to choose
int main() {
int idx = 0;
int count = idx;
Menu menu(\"Reports\");
Data temp;
string fileName;
Report* phoneCompany;
Report* newReport(Report*, int&);
Report* deleteReport(Report*, int&, int);
int displayReport(Report*, int);
bool fileNameExists(string);
menu.addMenuItem(\"New Report\");
menu.addMenuItem(\"Delete a Report\");
menu.addMenuItem(\"Display a Report\");
ofstream openFile;
phoneCompany = NULL;
phoneCompany = new Report[count];
do {
cout << menu;
cin >> menu;
switch (menu.getChoice()) {
case \'1\':
cout << \"\ \\tEnter report name (TE??????): \";
cin >> fileName;
openFile.open(fileName + \".tel\");
if (openFile.good()) {
cout << \"\ \\tReport succesfully created.\ \";
phoneCompany[count].setFileName(fileName);
count++;
}
else {
cout << \"\ \\terror: Could not create report.\ \";
}
break;
case \'2\':
if (count != 0) {
do {
system(\"cls\");
cout << \"\ \ \\tDelete a Report:\ \ \";
idx = displayReport(phoneCompany, count);
if (between(idx, 0, count - 1)) {
phoneCompany = deleteReport(phoneCompany, count, idx);
idx = 0;
}
else
cout << \"\ \\terror: Report could not be deleted.\ \";
} while (idx != count);
}
else {
cout << \"\ \ \\tNo reports to delete.\ \ \";
system(\"pause\");
}
break;
case \'3\':
if (count != 0) {
do {
system(\"cls\");
cout << \"Display a Report:\ \ \";
idx = displayReport(phoneCompany, count);
system(\"cls\");
cout << \"\ \\t\" << phoneCompany[idx].getFileName();
cout << \"\ \ \\tWould you like to edit the report?\";
cout << \.
The document discusses the C programming language. It provides a brief history of C, describes its data types and operators. It then presents 26 sample C programs demonstrating basic concepts like input/output, conditional statements, loops, functions, arrays and strings. The programs cover calculations, pattern printing, factorial, Fibonacci series and other simple programming examples.
The document contains code snippets from multiple C programming practical examples involving functions, pointers, arrays, and parameter passing techniques like call by value and call by reference. Specifically, it includes programs to:
1) Calculate mathematical operations on a number using switch case
2) Check if a number is prime using a user-defined function
3) Sort three numbers in ascending order by passing pointers as arguments
4) Recursively check if a number is prime
5) Sort an array using a pointer
6) Demonstrate call by value parameter passing where the passed values are not modified in the function.
Similar to DAVID Patient Quality Assurance software (20)
1. MAT LAB program for DAVID Patient Quality Assurance software
%%%%%% DAVID Patient Quality Assurance software 'DQA' %%%%%%%%%%%%%%
%%% Run the program and key in the date as yyyy-mm-dd and click OK and choose
%%% The patient Data folder to be analyze
clear all;
clc;
if ~exist('Results','dir')
mkdir('Results');
end
date_to_print = datestr(now,'yyyy-mm-dd'); % date of irradiation
prompt = {'Enter Date:'};
dlg_title = 'Enter session date';
num_lines = 1;
def = {date_to_print};
answer = inputdlg(prompt,dlg_title,num_lines,def);
try
dnum = datenum(answer);
while datenum(datestr(now,'yyyy-mm-dd'))< dnum
h=warndlg('Huh! Cannot analyze future session try again!');
uiwait(h);
answer = inputdlg(prompt,dlg_title,num_lines,def);
dnum = datenum(answer);
end
date_to_print=answer{1}; %%%% '2013-10-09';
FolderName= uigetdir(pwd, 'Enter file to read');
F_cell=genpath(FolderName);
date_add='Session Date:';
repstr = [FolderName, ''];
F_cell = strrep(F_cell, repstr, '');
F_cell = strrep(F_cell, FolderName, '');
F_cell=regexp(F_cell, ';','split');
F_cell =F_cell(1:end-1);
%types={'NDD','DD','ED'};% with Electrical data
types={'DD'};% NO Electrical data
%suppressEmpty= false; % To suppress subject without error
suppressEmpty= false; % To show all subject including patients without error
%% directory and save folder structure
num_found=0;
o_tdir='Results';
filename=fullfile(['results_',datestr(now,'DD_mm_YY_HH-MM_SSAM.txt')]);
fid=fopen(fullfile(o_tdir,filename),'w');
fclose(fid);
out_sess =[];
h = waitbar(0,'Please wait...','Name','Analysing DAVID Patient Data');
steps=numel(F_cell);
for i=1:length(F_cell)
if ~isempty(F_cell(i))
fname=F_cell{i};
temp_files=dir(fullfile(FolderName, fname));
for file_num=1:length(temp_files)
2. tfname = temp_files(file_num).name;
if strcmp(tfname, '.')||strcmp(tfname,
'..')||temp_files(file_num).isdir
continue;
end
full_tfname = fullfile(FolderName,fname,tfname);
[pathstr, name, ext] = fileparts(full_tfname);
if ~strcmp(ext, '.dat')||~exist(full_tfname,'file')
continue
end
[isValidfile, data] = checkValidFile(full_tfname);
if ~isValidfile
continue
end
num_found = num_found+1;
out{num_found}.source = full_tfname;
out{num_found}.patientdata = data;
out{num_found}.data =readFile(full_tfname);
disp(['Processing file : ' full_tfname]);
%% Analyze data
% 'NDD' : for Non Deconvoluted,
% 'DD' : for Deconvoluted
% 'ED' : for Electrical Data
if isempty(out{num_found}.data.error)
% o_tfname = [name,'.txt'];
% o_tfname = ['Output.txt'];
% o_tdir=fullfile(tempFolder,fname);
[sess] = getDateSession(full_tfname, date_to_print) ;
if isempty(sess)|| (sess==0)
disp(['Cannot find date in file: ', full_tfname])
else
[out2] =
analyzeData(out{num_found},types,o_tdir,filename,sess,date_to_print,suppressE
mpty);
out_sess = sess;
disp('Processed successfully!');
end
else
disp('Could not process file: the file has an error!');
end
end
end
waitbar(i/steps,h,['Please wait...',num2str(i/steps*100),'%']);
end
close(h);
fid=fopen(fullfile(o_tdir,filename),'a+');
fprintf(fid,'----------------------------------------------------------------
---------');
fprintf(fid,'nn %-20s%40s','Physician/Arzt','Physicist/Physiker');
fclose(fid);
disp('Processing finished ..');
catch
3. errordlg({'Invalid input Date. Program will abort!'});
end
The Function that carry out the analysis
function [out] = analyzeData(Alldata,types,
path_name,filename,sess_num,date_to_print,suppressEmpty)
%ANALYZEDATA Summary of this function goes here
% Detailed explanation goes here
%types={'NDD','DD','ED'};
data=Alldata.data;
info=Alldata.patientdata;
%sess_num=14;
a=exist(path_name, 'dir');
if a ~= 7
mkdir(path_name);
end
out=[];
filename = fullfile(path_name, filename);
fid=fopen(filename,'a+');
if ~suppressEmpty
names = fieldnames(info);
fprintf(fid,'################################################################
####################n');
fprintf(fid,'source : %sn',Alldata.source);
for i=1:numel(names);
f=names{i};
fprintf(fid,[f,' : ',info.(f),'n']);
end
fprintf(fid,'%10s%10s%10s%10s%10s%10sn', 'Info
Type:','Beam','Type','Session','Segment','Leafs');
end
count=0;
for bm=1:data.info.BeamCount
BeamName =['BEAM_',num2str(bm)];
if ~isfield(data.info, BeamName)
continue
end
for tp=1:length(types)
TypeName=types{tp};
for sess=sess_num%1:data.info.SessionCount
if sess > data.info.SessionCount
disp('Session not found');
continue
end
SessionName =['SESSION_',num2str(sess)];
if ~isfield(data.info.(BeamName), TypeName)
continue
end
numSegs = data.info.(BeamName).(TypeName).SegmentCount;
tempData=data.beamData.(BeamName).(TypeName).(SessionName);
Ref=data.beamData.(BeamName).(TypeName).REFERENCE.SEG;
4. % res
for sg=1:numSegs
factorX0 = max(max(Ref(sg,:))).100;
factorX1 = max(max(tempData.SEG(sg,:))).100;
res= factorX1.*tempData.SEG(sg,:)-factorX0.*Ref(sg,:);
% res=factorX1(sg)* tempData.SEG(sg,:)-refs;
out.beamData.(BeamName).(TypeName).(SessionName).SEG(sg,:) =
res;
tempWarn = find((res>=3)&(res<5));
tmm='';
if ~isempty(tempWarn)
count=count+1;
out.AWData.(BeamName).(TypeName).(SessionName).(['SEG_',num2str(sg)]).Warn=te
mpWarn;
tmm='Warning';
if ~isempty(tmm)
if (count ==1)&&suppressEmpty
names = fieldnames(info);
fprintf(fid,'################################################################
####################n');
fprintf(fid,'source : %sn',Alldata.source);
for i=1:numel(names);
f=names{i};
fprintf(fid,[f,' : ',info.(f),'n']);
end
fprintf(fid,'%10s%10s%10s%10s%10s%10sn', 'Info
Type:','Beam','Type','Session','Segment','Leafs');
end
fprintf(fid,'%10s%10d%10s%10d%10d %sn', tmm,bm,
TypeName, sess, sg, ['[',num2str(tempWarn),']']);
end
% fprintf(fid,'%10s%10d%10s%10d%10d%15sn',
'Warning',bm, TypeName, sess, sg, ['[',num2str(tempWarn),']']);
end
tempAlarm = find(res>=5);
if ~isempty(tempAlarm)
count=count+1;
out.AWData.(BeamName).(TypeName).(SessionName).(['SEG_',num2str(sg)]).Alarm=t
empAlarm;
tmm='Alarm';
if ~isempty(tmm)
if (count ==1)&&suppressEmpty
names = fieldnames(info);
fprintf(fid,'################################################################
####################n');
fprintf(fid,'source : %sn',Alldata.source);
for i=1:numel(names);
f=names{i};
fprintf(fid,[f,' : ',info.(f),'n']);
end
fprintf(fid,'%10s%10s%10s%10s%10s%10sn', 'Info
Type:','Beam','Type','Session','Segment','Leafs');
5. end
fprintf(fid,'%10s%10d%10s%10d%10d %sn', tmm,bm,
TypeName, sess, sg, ['[',num2str(tempAlarm),']']);
end
% fprintf(fid,'%10s%10d%10s%10d%10d%15sn',
'Alarm',bm, TypeName, sess, sg, ['[',num2str(tempAlarm),']']);
end
end
end
end
end
if (count == 0)&&(~suppressEmpty)
fprintf(fid,'n++++++++++++++++++++++++++++ NO WARNING NOR ERROR FOUND
++++++++++++++++++++++++++++nn');
end
fprintf(fid,'nTreatment date: %s and session number: %dn',date_to_print,
sess_num);
fclose(fid);
end
Plot Function
function [ output_args ] = plotResults(data, out, types)
%PLOTRESULTS Summary of this function goes here
% Detailed explanation goes here
h=figure(1);
for bm=1:data.info.BeamCount
BeamName =['BEAM_',num2str(bm)];
if isfield(out.AWData, BeamName)
for tp=1:length(types)
TypeName=types{tp};
if isfield(out.AWData.(BeamName), TypeName)
for sess=1:data.info.SessionCount
SessionName =['SESSION_',num2str(sess)];
if isfield(out.AWData.(BeamName).(TypeName), SessionName)
numSegs =
data.info.(BeamName).(TypeName).SegmentCount;
for sg=1:numSegs
SegName = ['SEG_',num2str(sg)];
tt=['Beam: ',num2str(bm),', Type: ',TypeName,',
Session: ',num2str(sess),', Segment: ', num2str(sg)];
if
isfield(out.AWData.(BeamName).(TypeName).(SessionName), SegName)
subplot(2,2,1);
bar(data.beamData.(BeamName).(TypeName).REFERENCE.SEG(sg,:))
legend('Reference Data')
title(tt);
subplot(2,2,2)
segData=data.beamData.(BeamName).(TypeName).(SessionName).SEG(sg,:);
6. bar(segData)
legend('Measured Data')
subplot(2,2,3)
segData=out.beamData.(BeamName).(TypeName).(SessionName).SEG(sg,:);
bar(segData)
legend('Percentage Error');
subplot(2,2,4)
if
isfield(out.AWData.(BeamName).(TypeName).(SessionName).(SegName), 'Alarm')
segData=out.beamData.(BeamName).(TypeName).(SessionName).SEG(sg,:);
idx=
out.AWData.(BeamName).(TypeName).(SessionName).(SegName).Alarm;
bar(segData)
legend('Percentage Error');
hold on;
wd=zeros(size(segData));
wd(idx)=out.beamData.(BeamName).(TypeName).(SessionName).SEG(sg,idx);
bar(wd,'r')
legend('Percentage Error','Alarm');
end
if
isfield(out.AWData.(BeamName).(TypeName).(SessionName).(SegName), 'Warn')
segData=out.beamData.(BeamName).(TypeName).(SessionName).SEG(sg,:);
idx=
out.AWData.(BeamName).(TypeName).(SessionName).(SegName).Warn;
bar(segData)
legend();
hold on;
wd=zeros(size(segData));
wd(idx)=out.beamData.(BeamName).(TypeName).(SessionName).SEG(sg,idx);
bar(wd,'y')
legend('Percentage Error','Warning');
end
hold off;
pause
else
end
end
end
end
end
end
end
end
end
7. Function That Check for Validity of file
function [isValidfile, data] = checkValidFile( filename )
%CHECKVALIDFILE Summary of this function goes here
% detailed explanation goes here
%% Get number of sessions
fid = fopen(filename);
%% Get number of sessions
isValidfile = false;
data=[];
while ~feof(fid)
line=fgetl(fid);
temp=regexp(line,'PATIENT INFO:.*', 'match');
if ~isempty(temp)
data.firstname = fgetl(fid);
data.lastname = fgetl(fid);
data.id = fgetl(fid);
data.sex = fgetl(fid);
data.birthday = fgetl(fid);
while ~feof(fid)
line=fgetl(fid);
temp=regexp(line,'INFO SESSION.*', 'match');
if ~isempty(temp)
isValidfile = true;
break;
end
end
break;
end
end
fclose(fid);
end
Function That Read file from different folders
function data=readFile( filename)
% dataType can be :
% 1: 'NON-DECONVOLUTED DATA'
% 2: 'DECONVOLUTED DATA'
% 3: 'ELECTRICAL DATA'
dataType ={struct('Name','NDD','Value','NON-DECONVOLUTED DATA'),...
struct('Name','DD','Value','DECONVOLUTED DATA'),...
struct('Name','ED','Value','ELECTRICAL DATA')};
%This function generate a -mat binary file for a given patient's data
%NB: Output name must be a .mat file
%eg: readFile('patientfilename.dat','given file name outputfilename.mat');
%load('the given filename.mat')
%filename='I-HKBP1810.dat';
%eg - readFile('I-HKBP1810.dat','Ruthurp.mat');
%to open the file - load('Ruthurp.mat')
%for i=1: length(dataType)
[data.beamData, data.info, data.error] = readData(filename, dataType);
8. %end
%save(outfile, 'data');
end
function [data, info, error] = readData(filename, dataType)
fid = fopen(filename);
%% Get number of sessions
numOfSess = [];
data=[];
info=[];
error=[];
fileIsOk= true;
while ~feof(fid)&&isempty(numOfSess)
line=fgetl(fid);
temp=regexp(line,'# SESS.*', 'match');
if ~isempty(temp)
numOfSess= str2double(getPropValue(line,'SESS'))-1;
break;
end
end
%% Get number of sessions
numOfBeam = [];
while ~feof(fid)&&isempty(numOfBeam)
line=fgetl(fid);
temp=regexp(line,'# BEAMS.*', 'match');
if ~isempty(temp)
numOfBeam= str2double(getPropValue(line,'BEAMS'));
break;
end
end
%data = cell(1,numOfBeam);
info.BeamCount = numOfBeam;
info.SessionCount = numOfSess;
beamCount=0;
while ~feof(fid)
noNextSegError =[];
noNextSegErrorcnt=0;
if ((beamCount == numOfBeam) || (beamCount==0))
if (beamCount== numOfBeam)
beamCount =0;
else
line=fgetl(fid);
end
type=[];
for j=1:length(dataType)
temp=regexp(line,dataType{j}.Value, 'match');
if ~isempty(temp)
type=dataType{j};
break;
end
end
if isempty(type)
continue;
end
else
9. % beamCount= 0;
end
line=fgetl(fid);
temp=regexp(line,'BEAM', 'match');
if ~isempty(temp)
beamCount = beamCount+1;
beamName= ['BEAM_',num2str(beamCount)] ;
end
line=fgetl(fid);
temp=regexp(line,'# SEG.*', 'match');
if ~isempty(temp)
numOfSeg=str2double(getPropValue(line,'SEG'));
end
line=fgetl(fid);
temp=regexp(line,'# VALUES.*', 'match');
if ~isempty(temp)
numOfValues=str2double(getPropValue(line,'VALUES'));
end
info.(beamName).(type.Name).('SegmentCount') =numOfSeg;
info.(beamName).(type.Name).('ValuesCount') =numOfValues;
tempData=[];
noNextSeg = false;
for sessionCountTemp=1:numOfSess+1
if sessionCountTemp==1
sessionName='REFERENCE';
else
sessionCount= sessionCountTemp -1;
sessionName=['SESSION_',num2str(sessionCount)];
end
if ~noNextSeg
line=fgetl(fid);
end
segs=[];
noNextSeg = false;
for segCount=1:numOfSeg
line=fgetl(fid);
if isempty(strfind(line,['SEG ', num2str(segCount)]))
noNextSeg= true;
noNextSegErrorcnt = noNextSegErrorcnt+1;
noNextSegError{noNextSegErrorcnt}.session=sessionCountTemp-
1;
noNextSegError{noNextSegErrorcnt}.seg=segCount-1;
noNextSegError{noNextSegErrorcnt}.segexpected=numOfSeg;
break;
end
value = getPropValue( line,'SEG');
eval(['value=[',value{1},']'';'])
st=length(value)-numOfValues+1;
segs(segCount,:) =value(st:end);
end
% tempData.(sessionName).('Ref') = segs(1,:);
tempData.(sessionName).('SEG') = segs;
end