Category: News
How to post using jquery to asp.net core api
I’m trying to develop a simple app to post to an api using jquery. I’ve tried multiple online suggestions and none of them work. I’ve even tried some of the AI code without success.
I can get GET to reply back with data but POST is just not working. Going on my 3rd day on this. Please help.
This is my api code:
This is what I’m trying.
Thanks for your time.
I’m trying to develop a simple app to post to an api using jquery. I’ve tried multiple online suggestions and none of them work. I’ve even tried some of the AI code without success. I can get GET to reply back with data but POST is just not working. Going on my 3rd day on this. Please help.This is my api code: This is what I’m trying. Thanks for your time. Read More
error message keeps showing on opening file
I’m working in excel and I have an error that keeps popping up on opening of the workbook.
Below is the error:
“cannot find #REF!#REF!, which has been assigned to run each time [xxx.xls] is opened.continuing…..”
Now it always looks like there is something wrong with the file. Anyone knows how to solve this?
I’m working in excel and I have an error that keeps popping up on opening of the workbook.Below is the error:”cannot find #REF!#REF!, which has been assigned to run each time [xxx.xls] is opened.continuing…..”Now it always looks like there is something wrong with the file. Anyone knows how to solve this? Read More
New Blog | Guided walkthrough of the Microsoft Purview extended report experience
This is a step-by-step guided walkthrough of the Microsoft Purview extended report experience and how it can empower your organization to understand the cyber security risks in a context that allows them to achieve more. By focusing on the information and organizational context to reflect the real impact/value of investments and incidents in cyber.
Prerequisites
License requirements for Microsoft Purview Information Protection depend on the scenarios and features you use. To understand your licensing requirements and options for Microsoft Purview Information Protection, see the Information Protection sections from Microsoft 365 guidance for security & compliance and the related PDF download for feature-level licensing requirements. For the best experience, all Microsoft Defender products should be enabled.
Follow the step-by-step guide to set up the reporting found here.
The DLP incident management documentation can be found here.
Install Power BI Desktop to make use of the templates Downloads | Microsoft Power BI
Read the full post here: Guided walkthrough of the Microsoft Purview extended report experience
By Jon Nordström
This is a step-by-step guided walkthrough of the Microsoft Purview extended report experience and how it can empower your organization to understand the cyber security risks in a context that allows them to achieve more. By focusing on the information and organizational context to reflect the real impact/value of investments and incidents in cyber.
Prerequisites
License requirements for Microsoft Purview Information Protection depend on the scenarios and features you use. To understand your licensing requirements and options for Microsoft Purview Information Protection, see the Information Protection sections from Microsoft 365 guidance for security & compliance and the related PDF download for feature-level licensing requirements. For the best experience, all Microsoft Defender products should be enabled.
Follow the step-by-step guide to set up the reporting found here.
The DLP incident management documentation can be found here.
Install Power BI Desktop to make use of the templates Downloads | Microsoft Power BI
Read the full post here: Guided walkthrough of the Microsoft Purview extended report experience
New Blog | How to build the Microsoft Purview Extended Report Experience
By
This is a step-by-step guided walkthrough of the extended report experience.
Prerequisites
License requirements for Microsoft Purview Information Protection depend on the scenarios and features you use. To understand your licensing requirements and options for Microsoft Purview Information Protection, see the Information Protection sections from Microsoft 365 guidance for security & compliance and the related PDF download for feature-level licensing requirements.
Before you start, all endpoint interaction with Sensitive content is already being included in the audit logging with Endpoint DLP enabled. For Microsoft 365 SharePoint, OneDrive Exchange, Teams you can enable policies that generate events but not incidents for important sensitive information types.
Install Power BI Desktop to make use of the templates Downloads | Microsoft Power BI
Read the full post here: How to build the Microsoft Purview Extended Report Experience
By
This is a step-by-step guided walkthrough of the extended report experience.
Prerequisites
License requirements for Microsoft Purview Information Protection depend on the scenarios and features you use. To understand your licensing requirements and options for Microsoft Purview Information Protection, see the Information Protection sections from Microsoft 365 guidance for security & compliance and the related PDF download for feature-level licensing requirements.
Before you start, all endpoint interaction with Sensitive content is already being included in the audit logging with Endpoint DLP enabled. For Microsoft 365 SharePoint, OneDrive Exchange, Teams you can enable policies that generate events but not incidents for important sensitive information types.
Install Power BI Desktop to make use of the templates Downloads | Microsoft Power BI
Read the full post here: How to build the Microsoft Purview Extended Report Experience Read More
New Blog | Learn how to customize Copilot for Security with the Data Security plugin
This is a step-by-step guided walkthrough of how to use the custom Copilot for Security pack for Microsoft Data Security and how it can empower your organization to understand the cyber security risks in a context that allows them to achieve more. By focusing on the information and organizational context to reflect the real impact/value of investments and incidents in cyber. We are working to add this to our native toolset as well, we will update once ready.
Prerequisites
License requirements for Microsoft Purview Information Protection depend on the scenarios and features you use. To understand your licensing requirements and options for Microsoft Purview Information Protection, see the Information Protection sections from Microsoft 365 guidance for security & compliance and the related PDF download for feature-level licensing requirements. You also need to be licensed for Microsoft Copilot for Security, more information here.
Consider setting up Azure AI Search to ingest policy documents, so that they can be part of the process.
Read the full post here: Learn how to customize and optimize Copilot for Security with the custom Data Security plugin
By Jon Nordström
This is a step-by-step guided walkthrough of how to use the custom Copilot for Security pack for Microsoft Data Security and how it can empower your organization to understand the cyber security risks in a context that allows them to achieve more. By focusing on the information and organizational context to reflect the real impact/value of investments and incidents in cyber. We are working to add this to our native toolset as well, we will update once ready.
Prerequisites
License requirements for Microsoft Purview Information Protection depend on the scenarios and features you use. To understand your licensing requirements and options for Microsoft Purview Information Protection, see the Information Protection sections from Microsoft 365 guidance for security & compliance and the related PDF download for feature-level licensing requirements. You also need to be licensed for Microsoft Copilot for Security, more information here.
Consider setting up Azure AI Search to ingest policy documents, so that they can be part of the process.
Read the full post here: Learn how to customize and optimize Copilot for Security with the custom Data Security plugin Read More
MDM Entra and MDM Authority and MDM in Intune?!!
Alright folks, I’ve been beating my head against a wall for two weeks and I can’t do it any longer.
I’ll preface this with, “I’m new to this.” That said, I’m great at figuring stuff out but the documentation on this process is lacking in so many ways.
I’ve come on with a company that was, as far as I can tell, not managing their devices (in this case, Windows devices). I set about learning everything I could about Entra/Azure (whatever we’re calling it these days) and Intune, registering devices, enrolling devices, etc.
We currently pay for 25 Intune licenses. I have one. My Test User account has one. My DEM user has one (which I’ve set up as a DEM in Intune). And one of our actual employees has one. Both devices were set up as an OOBE (one brand new and one wiped and reset). For one of them I used ‘Work/School’ login on startup and signed in with my DEM account. For the other I used ‘Work/School’ and signed in with my Test User account.
First thing I knew was to make sure our MDM Authority was set to Intune. I checked and it’s currently reading as “Microsoft Office 365” (see image) I’ve read about an ‘orange bar.’ I don’t have an orange bar. I read about, “Depending on whether your tenant was pre or post 1911 Service Release, Intune is automatically set as your MDM.” and “If Mobile Device Management Authority was set, you cannot change this.”
So, my first question.. because I’m confused. How is someone supposed to know what their current MDM is set to if nothing reads as all of the documentation reads. How do I know if MDMA was set as the MDM and, if so, is Microsoft Office 365 the same thing as MDMA (for some silly reason)? And if my MDM was set and now I can’t change it, do I just assume that even though it says ONE thing, I’m supposed to just ignore it and believe my MDM is actually Intune?
That’s the first issue.
Second. In Entra/Azure the two devices I’ve been using to try and understand this convoluted process say they are being managed (MDM) by”Office 365 Mobile.” What the actual… is Office 365 Mobile really Microsoft Office 365 which is really Intune???? I’m lost. (see image)
To make matters worse/more confusing. IN Intune when I look at the devices, it says there the devices MDM is INTUNE!?!! (see image)
I don’t really know what I’m missing. I keep reading something about adding Intune as an MDM Authority and being able to choose which Authority I am using to manage devices but, as with everything Microsoft, who knows what’s changed since all of this documentation, blog posts, etc. were written. I can’t, for the life of me, find anywhere to ‘add’ Intune.
Can someone PLEASE help me understand this. I’ve been at this for weeks, I have a timeline as we’re rolling out a bunch of new devices and I don’t want to miss this opportunity to do it the right way.
I feel like I’m getting close but, on top of being unsure of whether they are even actually being managed by Intune, none of the basic policies I’ve created are being pushed to the devices regardless of how many times I’ve checked to make sure the users are in the right group, etc. etc. etc.
I’ve tried adding corporate identifiers. I feel like I’ve tried everything.
I’m pulling my hair out.
Alright folks, I’ve been beating my head against a wall for two weeks and I can’t do it any longer.I’ll preface this with, “I’m new to this.” That said, I’m great at figuring stuff out but the documentation on this process is lacking in so many ways.I’ve come on with a company that was, as far as I can tell, not managing their devices (in this case, Windows devices). I set about learning everything I could about Entra/Azure (whatever we’re calling it these days) and Intune, registering devices, enrolling devices, etc. We currently pay for 25 Intune licenses. I have one. My Test User account has one. My DEM user has one (which I’ve set up as a DEM in Intune). And one of our actual employees has one. Both devices were set up as an OOBE (one brand new and one wiped and reset). For one of them I used ‘Work/School’ login on startup and signed in with my DEM account. For the other I used ‘Work/School’ and signed in with my Test User account. First thing I knew was to make sure our MDM Authority was set to Intune. I checked and it’s currently reading as “Microsoft Office 365” (see image) I’ve read about an ‘orange bar.’ I don’t have an orange bar. I read about, “Depending on whether your tenant was pre or post 1911 Service Release, Intune is automatically set as your MDM.” and “If Mobile Device Management Authority was set, you cannot change this.”So, my first question.. because I’m confused. How is someone supposed to know what their current MDM is set to if nothing reads as all of the documentation reads. How do I know if MDMA was set as the MDM and, if so, is Microsoft Office 365 the same thing as MDMA (for some silly reason)? And if my MDM was set and now I can’t change it, do I just assume that even though it says ONE thing, I’m supposed to just ignore it and believe my MDM is actually Intune?That’s the first issue.Second. In Entra/Azure the two devices I’ve been using to try and understand this convoluted process say they are being managed (MDM) by”Office 365 Mobile.” What the actual… is Office 365 Mobile really Microsoft Office 365 which is really Intune???? I’m lost. (see image)To make matters worse/more confusing. IN Intune when I look at the devices, it says there the devices MDM is INTUNE!?!! (see image)I don’t really know what I’m missing. I keep reading something about adding Intune as an MDM Authority and being able to choose which Authority I am using to manage devices but, as with everything Microsoft, who knows what’s changed since all of this documentation, blog posts, etc. were written. I can’t, for the life of me, find anywhere to ‘add’ Intune. Can someone PLEASE help me understand this. I’ve been at this for weeks, I have a timeline as we’re rolling out a bunch of new devices and I don’t want to miss this opportunity to do it the right way.I feel like I’m getting close but, on top of being unsure of whether they are even actually being managed by Intune, none of the basic policies I’ve created are being pushed to the devices regardless of how many times I’ve checked to make sure the users are in the right group, etc. etc. etc.I’ve tried adding corporate identifiers. I feel like I’ve tried everything.I’m pulling my hair out. Read More
PerfView: ASP.NET Core Stats View
This is something I built earlier this year and it was merged into the main PerfView source in mid-April, and released in v3.1.10. It’s a view that was built to consume Microsoft.AspNetCore.Hosting EventSource events and display a page similar to the IIS Stats view for those that are familiar with that one. If any of those events exist in a trace being opened by PerfView, the stats view will be available. If the trace doesn’t contain any of those events, then the view will not be visible.
Additionally, in the past couple months, the Azure App Service Product Group modified the DaaS (Diagnostics as a Service) .NET Profiler trace to automatically collect these events on both Linux and Windows App Services. This means recent App Service traces (from within the last ~1month or so) will have the events and thus the view should be available when the trace is opened in PerfView.
Where is it?
When opening a trace containing the aforementioned events in PerfView v3.1.10+, the new view will be exposed in the Advanced folder:
What does it look like?
Fortunately, it looks the same regardless of what kind of trace you’re looking at:
That one is from a dotnet-trace taken from one of my Linux App Services via the .NET Profiler (under-the-hood this profiler just uses a preconfigured dotnet-trace command).
Here is one from a Windows App Service, also captured via .NET Profiler (these come as ZIPs, extract the zip so PerfView can open the .diagsession file):
Side note about the Windows App Service profiler traces – these are saved as ZIP files. The zip must be extracted so PerfView can get to the .diagsession file inside. When viewing the .diagsession in PerfView, there is an unresolved bug where it doesn’t refresh the screen:
So double-clicking won’t give you the option to expand the trace (i.e. the arrow above won’t show up) – you can just refresh the window with F5 and the arrow will appear. From there you can expand the trace like the screenshot shown earlier.
So what about non-AppService scenarios?
The events can be captured with PerfView by adding the “*Microsoft.AspNetCore.Hosting” provider in the GUI or the command line (note the asterisk * – that is critical for PerfView to be able to capture any .NET/Core event sources):
Command-line:
PerfView.exe “/DataFile:PerfViewData.etl” /BufferSizeMB:512 /StackCompression /CircularMB:500 /Providers:”*Microsoft.AspNetCore.Hosting,Microsoft-Windows-IIS,*Microsoft-Extensions-Logging:4:5″ /ContinueOnError /NoGui /NoNGenRundown collect
Or captured using dotnet-trace (does not need the leading asterisk):
dotnet-trace collect –providers Microsoft.AspNetCore.Hosting,Microsoft-Extensions-Logging:4:5 -p ###
What if I’m interested in a specific request?
Clicking the ActivityId of that request will open the Events view with that ID as a text filter and the start and stop time of the events being specific to that request (all of the events are selected by-default):
Notice the first event in that list is Microsoft.AspNetCore.Hosting/Request/Start – the last one should be the corresponding Request/Stop event, assuming the trace contains it.
Any other events that contain that ActivityId will also be displayed. You can then filter through these events as usual (removing different types you don’t care about, etc.) to hone-in on what you want to see.
I have already used this view many times as it saves many clicks when looking for specific requests and such. Hopefully it helps you too!
If capturing your own trace, I strongly recommend also including the Microsoft-Extensions-Logging:4:5 provider (yes those are dashes, and don’t forget the leading asterisk if using PerfView to capture, otherwise it’s the same) as that is where ASP.NET Core itself writes its logs, as well as anything else that uses ILogger. Sometimes those events aren’t available for various reasons, but when they are they’re usually helpful. The 4 in that provider is the keyword and for that provider it means capture only the FormattedMessage events, while the 5 is the verbosity (5=verbose). See: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-8.0#dotnet-trace-tooling
Over time, as time is available, I plan to tweak the view and try to add more features to it.
Related links:
Original PR: https://github.com/microsoft/perfview/pull/2001
Added clickable ActivityIds to bring up the Events view: https://github.com/microsoft/perfview/pull/2028
PerfView 3.1.10 release where this was first available: https://github.com/microsoft/perfview/releases/tag/v3.1.10
Latest PerfView release (currently 3.1.13): https://github.com/microsoft/perfview/releases/latest
Microsoft Tech Community – Latest Blogs –Read More
Live script fprintf temporarily not printing whole line
While doing a bunch of file IO in a Live Script, and printing with fprintf, sometimes the line does not complete printing. Temporarily, it looks like the image below until the next iteration begins.
I was able to sort of recreate the effect with the code below, but what can be only a flicker in the execution of this snippet is much more noticable on my other project.
for i= 1:10
fprintf("Hello %dn",i)
B= inv(rand(3000)+ 2*eye(3000));
end
Is this a bug or am I missing something?While doing a bunch of file IO in a Live Script, and printing with fprintf, sometimes the line does not complete printing. Temporarily, it looks like the image below until the next iteration begins.
I was able to sort of recreate the effect with the code below, but what can be only a flicker in the execution of this snippet is much more noticable on my other project.
for i= 1:10
fprintf("Hello %dn",i)
B= inv(rand(3000)+ 2*eye(3000));
end
Is this a bug or am I missing something? While doing a bunch of file IO in a Live Script, and printing with fprintf, sometimes the line does not complete printing. Temporarily, it looks like the image below until the next iteration begins.
I was able to sort of recreate the effect with the code below, but what can be only a flicker in the execution of this snippet is much more noticable on my other project.
for i= 1:10
fprintf("Hello %dn",i)
B= inv(rand(3000)+ 2*eye(3000));
end
Is this a bug or am I missing something? live, script, fprinf MATLAB Answers — New Questions
Matlab code for calculating characteristics equation
I have the code below to obtain the characteristic equation of a 6by6 matrix but it giving me an error of sym
% Define a symbolic 6×6 matrix with entries as a mixture of alphabet letters and zeros
syms a b c d e f g h i j k l m n p q r s t I v w x y z
A = [-a 0 b -c d e; f -g 0 0 h 0; 0 0 -i c 0 e; 0 0 j -k 0 0; 0 0 0 l -m 0; 0 0 0 n 0 -p];
% Calculate the characteristic polynomial of the matrix A
char_eqn = charpoly(A);
disp(‘The characteristic equation of the matrix A is:’)
disp(char_eqn)I have the code below to obtain the characteristic equation of a 6by6 matrix but it giving me an error of sym
% Define a symbolic 6×6 matrix with entries as a mixture of alphabet letters and zeros
syms a b c d e f g h i j k l m n p q r s t I v w x y z
A = [-a 0 b -c d e; f -g 0 0 h 0; 0 0 -i c 0 e; 0 0 j -k 0 0; 0 0 0 l -m 0; 0 0 0 n 0 -p];
% Calculate the characteristic polynomial of the matrix A
char_eqn = charpoly(A);
disp(‘The characteristic equation of the matrix A is:’)
disp(char_eqn) I have the code below to obtain the characteristic equation of a 6by6 matrix but it giving me an error of sym
% Define a symbolic 6×6 matrix with entries as a mixture of alphabet letters and zeros
syms a b c d e f g h i j k l m n p q r s t I v w x y z
A = [-a 0 b -c d e; f -g 0 0 h 0; 0 0 -i c 0 e; 0 0 j -k 0 0; 0 0 0 l -m 0; 0 0 0 n 0 -p];
% Calculate the characteristic polynomial of the matrix A
char_eqn = charpoly(A);
disp(‘The characteristic equation of the matrix A is:’)
disp(char_eqn) syms, symbolic MATLAB Answers — New Questions
Homepage tab not loading 128.0.2739.42
The latest stable version of Edge seems to have broken the new tab homepage for us. The tab opens but just says “loading” and never completes. Opening a new tab resolves the issue. This is only happening on Stable, not in Canary or Dev, version 128.0.2739.42.
The latest stable version of Edge seems to have broken the new tab homepage for us. The tab opens but just says “loading” and never completes. Opening a new tab resolves the issue. This is only happening on Stable, not in Canary or Dev, version 128.0.2739.42. Read More
Sharepoint & OneDrive idle timeout when using desktop app
There are users in our facility who only rarely interact with Microsoft apps outside of one log per department. Last month on July 9, we moved the two essential logs onto a pair of Sharepoint sites, and set these users up with OneDrive shortcuts that open the content in desktop Excel, which is installed through our Microsoft 365 license.
Sometime on Wednesday, the OneDrive and Sharepoint sign-ins for all 3 users signed out, despite the fact they were accessing these logs every day through the desktop apps. I just had to run around, signing everything in and making backups to keep Sharepoint from overwriting the last few days of work.
Why would they time out despite accessing these shared files every day?
How do we prevent this from happening again?
There are users in our facility who only rarely interact with Microsoft apps outside of one log per department. Last month on July 9, we moved the two essential logs onto a pair of Sharepoint sites, and set these users up with OneDrive shortcuts that open the content in desktop Excel, which is installed through our Microsoft 365 license. Sometime on Wednesday, the OneDrive and Sharepoint sign-ins for all 3 users signed out, despite the fact they were accessing these logs every day through the desktop apps. I just had to run around, signing everything in and making backups to keep Sharepoint from overwriting the last few days of work. Why would they time out despite accessing these shared files every day?How do we prevent this from happening again? Read More
Formula Fill When Inserting Row
I have one table which lists a trailer number, the section of the yard in which it is parked, and then the row inside the parking spot (TrailerList). I also have a table which will show visually where the trailer is parked based on this list (TrailerPark). I have it set to auto-populate the trailer name from TrailerList into the correct location in TrailerPark using the formula =IFERROR(INDEX(TrailerList[[Trailer]:[Trailer]],MATCH(1,(TrailerList[[Section]:[Section]]=”A1″)*(TrailerList[[Row]:[Row]]=”1-1″),0)),””). The issue I have is I frequently need to adjust the size of a section (ex: making section “A1” 23 rows instead of 21 as shown). Currently when I add a row the new cells hold the formula from the top row, and pushes the old row 4 formula down to row 5. Is there a way to dynamically fil the formula to match its battleship grid location? Or at least keep the moved formula relevant to the row it gets moved to?
I have one table which lists a trailer number, the section of the yard in which it is parked, and then the row inside the parking spot (TrailerList). I also have a table which will show visually where the trailer is parked based on this list (TrailerPark). I have it set to auto-populate the trailer name from TrailerList into the correct location in TrailerPark using the formula =IFERROR(INDEX(TrailerList[[Trailer]:[Trailer]],MATCH(1,(TrailerList[[Section]:[Section]]=”A1″)*(TrailerList[[Row]:[Row]]=”1-1″),0)),””). The issue I have is I frequently need to adjust the size of a section (ex: making section “A1” 23 rows instead of 21 as shown). Currently when I add a row the new cells hold the formula from the top row, and pushes the old row 4 formula down to row 5. Is there a way to dynamically fil the formula to match its battleship grid location? Or at least keep the moved formula relevant to the row it gets moved to? Read More
Data Classification and Labelling in Azure SQL Database | Data Exposed
In this episode of Data Exposed with Anna Hoffman and Madhumita Tripathy, we talk about labelling a column in Azure SQL Database using Microsoft Information Protection (MIP) policy and propagation of MIP sensitivity labels from SQL Database to downstream applications such as Power BI reports and Office applications.
Resources:
Data Discovery & Classification
Data Discovery & Classification is now free for Azure SQL Database & Azure Synapse Analytics
Discovering, classifying, labeling & protecting SQL data – now available for all
View/share our latest episodes on Microsoft Learn and YouTube!
Microsoft Tech Community – Latest Blogs –Read More
Fastest Way of Opening and Reading .csv Files (Currently using xlsread)
I am currently trying to convert 100,000+ csv files (all the same size, with the same data structuring on the inside) to mat files, and I am running into the issue that it takes an extremely long time, and sometimes Excel stops responding. Are there any other functions that could cut down on the read time of these .csv files?
I read something about trying the COM server that runs Excel, but I am not sure how to implement it. Any thoughts?I am currently trying to convert 100,000+ csv files (all the same size, with the same data structuring on the inside) to mat files, and I am running into the issue that it takes an extremely long time, and sometimes Excel stops responding. Are there any other functions that could cut down on the read time of these .csv files?
I read something about trying the COM server that runs Excel, but I am not sure how to implement it. Any thoughts? I am currently trying to convert 100,000+ csv files (all the same size, with the same data structuring on the inside) to mat files, and I am running into the issue that it takes an extremely long time, and sometimes Excel stops responding. Are there any other functions that could cut down on the read time of these .csv files?
I read something about trying the COM server that runs Excel, but I am not sure how to implement it. Any thoughts? excel, m, .mat, conversion, xlsread, csvread MATLAB Answers — New Questions
How can I create an impulse (delta) signal in Simulink?
How can I create an impulse (delta) signal in Simulink? I looked for it in "Sources" library but there is not.How can I create an impulse (delta) signal in Simulink? I looked for it in "Sources" library but there is not. How can I create an impulse (delta) signal in Simulink? I looked for it in "Sources" library but there is not. #simulink MATLAB Answers — New Questions
How reduce data from 3917×2 to 1868×2 without change the entire of graph?
I have zdata.mat contains data 3917×2 I need a way to reduce data to 1868×2 , (hint: first column refers to x axis, second column refers to y axis)I have zdata.mat contains data 3917×2 I need a way to reduce data to 1868×2 , (hint: first column refers to x axis, second column refers to y axis) I have zdata.mat contains data 3917×2 I need a way to reduce data to 1868×2 , (hint: first column refers to x axis, second column refers to y axis) reduce, size MATLAB Answers — New Questions
Microsoft Loop in Outlook (Permissions not working)
Up until recently when using a Microsoft Loop component inside Outlook you were able to add users to the email where Loop was embedded, and they would inherit permissions to that Loop component, and they were able to update within that Loop component.
What I’m seeing now and what’s being reported by end users is that when you go through the same steps and send the email to the recipients, they do not have access. They have to request access to the Loop component.
Has anyone experienced this recently? The only workaround it to create the Loop component outside of Outlook using the Loop app, or the web version where you can add the users
Up until recently when using a Microsoft Loop component inside Outlook you were able to add users to the email where Loop was embedded, and they would inherit permissions to that Loop component, and they were able to update within that Loop component. What I’m seeing now and what’s being reported by end users is that when you go through the same steps and send the email to the recipients, they do not have access. They have to request access to the Loop component. Has anyone experienced this recently? The only workaround it to create the Loop component outside of Outlook using the Loop app, or the web version where you can add the users Read More
Formül kopyalama
İçinde formül bulunan birden fazla hücre nasıl kopyalanır?
Ör:
A1, B1, C1, …, AA1
veya
A1
A2
A3
.
.
.
A99
Toplu halde formüller değişmeden başka sayfaya kopyalamak istiyorum. Nasıl yapabilirim.
(Herbir hücrede formül var.)
İçinde formül bulunan birden fazla hücre nasıl kopyalanır?Ör: A1, B1, C1, …, AA1veyaA1A2A3…A99Toplu halde formüller değişmeden başka sayfaya kopyalamak istiyorum. Nasıl yapabilirim.(Herbir hücrede formül var.) Read More
Equation Editor Wrong Highlight Color In Dark Mode
The highlight color in the Equation Editor is not correct when using dark mode in Word. The white text is unreadable. I’m seeing posts mentioning this issue from 4 years ago. How has this not been patched? How do I fix this myself if Microsoft won’t?
The highlight color in the Equation Editor is not correct when using dark mode in Word. The white text is unreadable. I’m seeing posts mentioning this issue from 4 years ago. How has this not been patched? How do I fix this myself if Microsoft won’t? Read More
I am using a GUI already made, it is giving error of input argument is unused. I cannot run this code due the multiple error message like this. error highlights these variable
function varargout = FLIM_processing(varargin)
% FLIM_PROCESSING MATLAB code for FLIM_processing.fig
% FLIM_PROCESSING, by itself, creates a new FLIM_PROCESSING or raises the existing
% singleton*.
%
% H = FLIM_PROCESSING returns the handle to a new FLIM_PROCESSING or the handle to
% the existing singleton*.
%
% FLIM_processing(‘CALLBACK’,hObject,eventData,handles,…) calls the local
% function named CALLBACK in FLIM_processing.M with the given input arguments.
%
% FLIM_processing(‘Property’,’Value’,…) creates a new FLIM_processing or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before FLIM_processing_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to FLIM_processing_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE’s Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help FLIM_processing
% Last Modified by GUIDE v2.5 13-Apr-2021 19:57:16
% Begin initialization code – DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @FLIM_processing_OpeningFcn, …
‘gui_OutputFcn’, @FLIM_processing_OutputFcn, …
‘gui_LayoutFcn’, [] , …
‘gui_Callback’, []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code – DO NOT EDIT
% — Executes just before FLIM_processing is made visible.
function FLIM_processing_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to FLIM_processing (see VARARGIN)
% Choose default command line output for FLIM_processing
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes FLIM_processing wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% — Outputs from this function are returned to the command line.
function varargout = FLIM_processing_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
%% Get the NADH Image Button
% — Executes on button press in pushbutton1.
function read_NADH_intensity_Callback(~, ~, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global maskShowImage;
global nadhImageName;
global nadhFileName;
global nadhPathName;
% Get the location of the image
[nadhFileName, nadhPathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhTextImage = importdata(strcat(nadhPathName,nadhFileName));
nadhTextImage(nadhTextImage > 1000) = 0;
nadhTextImage(:,245:256)=0;
maskShowImage = nadhTextImage;
nadhImageName = {nadhFileName,’NADH’};
% display the NADH image in axes1
maxIntensityValue = max(nadhTextImage(:));
minIntensityValue = min(nadhTextImage(:));
set(handles.slider3,’Max’,maxIntensityValue);
set(handles.slider3,’Min’,minIntensityValue);
set(handles.text19,’String’,num2str(minIntensityValue));
set(handles.text20,’String’,num2str(maxIntensityValue));
set(handles.text23,’String’,nadhFileName);
axes(handles.axes1);
imagesc(nadhTextImage)
colormap(gray)
colorbar
axes(handles.axes4);
imagesc(maskShowImage)
colormap(gray)
colorbar
%% Get the Mask Image Button
% — Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global maskImage;
global nadhThreshold;
% get the image mask
maskImage = nadhTextImage;
nadhThreshold = get(handles.edit1,’String’);
nadhThreshold = str2double( nadhThreshold );
maskImage(maskImage < nadhThreshold) = 0;
maskImage(maskImage~=0) = 1;
% display the mask Image axes4
axes(handles.axes4);
imagesc(maskImage)
colormap(gray)
colorbar
%% read FAD intensity image
% — Executes on button press in readFADIntensity.
function read_FAD_intensity_Callback(hObject, eventdata, handles)
% hObject handle to readFADIntensity (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadTextImage
% Get the location of the image
global fadImageName;
global fadFileName;
global fadPathName;
[fadFileName, fadPathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadImageName = {fadFileName,’FAD’};
fadTextImage = importdata(strcat(fadPathName,fadFileName));
fadTextImage(fadTextImage > 1000) = 0;
fadTextImage(:,245:256)=0;
% display the NADH image in axes1
set(handles.text24,’String’,fadFileName);
axes(handles.axes2);
imagesc(fadTextImage)
colormap(gray)
colorbar
%% Read NADH T1 Image
% — Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT1Image;
% Get the location of the image
[nadhT1FileName, nadhT1PathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhT1Image = importdata(strcat(nadhT1PathName,nadhT1FileName));
nadhT1Image(nadhT1Image > 8000) = 0;
nadhT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes7);
imagesc(nadhT1Image)
colormap(gray)
colorbar
set(handles.text7 , ‘String’, nadhT1FileName);
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit1 as text
% str2double(get(hObject,’String’)) returns contents of edit1 as a double
% — Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
% — Executes during object deletion, before destroying properties.
function edit1_DeleteFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%% Calculate Redox Ratio Button
% — Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global fadTextImage;
global redoxRatioImage;
redoxRatioImage = nadhTextImage./(nadhTextImage + fadTextImage);
axes(handles.axes6);
imagesc(redoxRatioImage)
colormap(gray)
colorbar
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit2 as text
% str2double(get(hObject,’String’)) returns contents of edit2 as a double
% — Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
% — Executes on button press in pushbutton6.
function pushbutton6_Callback(~, ~, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global fadTextImage;
global redoxRatioImage;
global maskImage;
global redoxRatio;
nadhIntensityImage = nadhTextImage.* maskImage;
fadIntensityImage = fadTextImage.* maskImage;
axes(handles.axes1);
imagesc(nadhIntensityImage)
colormap(gray)
colorbar
axes(handles.axes2);
imagesc(fadIntensityImage)
colormap(gray)
colorbar
redoxRatioIntensityImage = redoxRatioImage.* maskImage;
axes(handles.axes6);
imagesc(redoxRatioIntensityImage)
colormap(gray)
colorbar
redoxRatio = mean(redoxRatioIntensityImage(redoxRatioIntensityImage~=0),’omitnan’);
set(handles.edit2 , ‘String’, num2str(redoxRatio));
%% Read NADH T2 Image and display
% — Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT2Image;
% Get the location of the image
[nadhT2FileName, nadhT2PathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhT2Image = importdata(strcat(nadhT2PathName,nadhT2FileName));
nadhT2Image(nadhT2Image > 8000) = 0;
nadhT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes8);
imagesc(nadhT2Image)
colormap(gray)
colorbar
set(handles.text8 , ‘String’, nadhT2FileName);
%% Read NADH alpha Image and display
% — Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhAlphaImage;
% Get the location of the image
[nadhAlphaFileName, nadhAlphaPathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhAlphaImage = importdata(strcat(nadhAlphaPathName,nadhAlphaFileName));
nadhAlphaImage(nadhAlphaImage>100) = 0;
nadhAlphaImage(nadhAlphaImage<0) = 0;
nadhAlphaImage(:,245:256) = 0;
% display the NADH image in axes7 and show the image name
axes(handles.axes9);
imagesc(nadhAlphaImage)
colormap(gray)
colorbar
set(handles.text9 , ‘String’, nadhAlphaFileName);
%% Calculate NADH FLIM mean
% — Executes on button press in pushbutton9.
function pushbutton9_Callback(~, eventdata, handles)
% hObject handle to pushbutton9 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT1Image;
global nadhT2Image;
global nadhAlphaImage;
global maskImage;
global nadhT1Mean;
global nadhT2Mean;
global nadhAlphaMean;
global nadhFLIMMMean;
nadhFLIMMImage = (nadhT1Image.* nadhAlphaImage + nadhT2Image.*(100 – nadhAlphaImage))/100;
nadhFLIMMImageM = nadhFLIMMImage .* maskImage;
nadhAlphaImageM = nadhAlphaImage.* maskImage;
nadhT2ImageM = nadhT2Image .* maskImage;
nadhT1ImageM = nadhT1Image .* maskImage;
nadhAlphaMean = mean(nadhAlphaImageM(nadhAlphaImageM~=0),’omitnan’);
nadhT2Mean = mean(nadhT2ImageM(nadhT2ImageM~=0),’omitnan’);
nadhT1Mean = mean(nadhT1ImageM(nadhT1ImageM~=0),’omitnan’);
nadhFLIMMMean = mean(nadhFLIMMImageM(nadhFLIMMImageM~=0),’omitnan’);
set(handles.edit3 , ‘String’, num2str(nadhT1Mean));
set(handles.edit4 , ‘String’, num2str(nadhT2Mean));
set(handles.edit5 , ‘String’, num2str(nadhAlphaMean));
set(handles.edit6 , ‘String’, num2str(nadhFLIMMMean));
axes(handles.axes7);
imagesc(nadhT1ImageM)
colormap(gray)
colorbar
axes(handles.axes8);
imagesc(nadhT2ImageM)
colormap(gray)
colorbar
axes(handles.axes9);
imagesc(nadhAlphaImageM)
colormap(gray)
colorbar
function edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit3 as text
% str2double(get(hObject,’String’)) returns contents of edit3 as a double
% — Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit4_Callback(hObject, ~, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit4 as text
% str2double(get(hObject,’String’)) returns contents of edit4 as a double
% — Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit5_Callback(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit5 as text
% str2double(get(hObject,’String’)) returns contents of edit5 as a double
% — Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit6_Callback(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit6 as text
% str2double(get(hObject,’String’)) returns contents of edit6 as a double
% — Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
%% Read FAD T1 image and display
% — Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton10 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadT1Image;
% Get the location of the image
[fadT1FileName, fadT1PathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadT1Image = importdata(strcat(fadT1PathName,fadT1FileName));
fadT1Image(fadT1Image > 8000) = 0;
fadT1Image(fadT1Image < 0) = 0;
fadT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes10);
imagesc(fadT1Image)
colormap(gray)
colorbar
set(handles.text10 , ‘String’, fadT1FileName);
% — Executes on button press in pushbutton11.
function pushbutton11_Callback(hObject, ~, handles)
% hObject handle to pushbutton11 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadT2Image;
% Get the location of the image
[fadT2FileName, fadT2PathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadT2Image = importdata(strcat(fadT2PathName,fadT2FileName));
fadT2Image(fadT2Image>8000) = 0;
fadT2Image(fadT2Image < 0) = 0;
fadT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes11);
imagesc(fadT2Image)
colormap(gray)
colorbar
set(handles.text11 , ‘String’, fadT2FileName);
% — Executes on button press in pushbutton12.
function pushbutton12_Callback(~, ~, handles)
% hObject handle to pushbutton12 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadAlphaImage;
% Get the location of the image
[fadAplhaFileName, fadAlphaPathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadAlphaImage = importdata(strcat(fadAlphaPathName,fadAplhaFileName));
fadAlphaImage(fadAlphaImage>100) = 0;
fadAlphaImage(fadAlphaImage<0) = 0;
fadAlphaImage(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes12);
imagesc(fadAlphaImage)
colormap(gray)
colorbar
set(handles.text12 , ‘String’, fadAplhaFileName);
% — Executes on button press in pushbutton13.
function pushbutton13_Callback(~, eventdata, handles)
% hObject handle to pushbutton13 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadT1Image;
global fadT2Image;
global fadAlphaImage;
global maskImage
global fadT1Mean;
global fadT2Mean;
global fadAlphaMean;
global fadFLIMMMean;
fadFLIMMImage = (fadT1Image.* fadAlphaImage + fadT2Image.*(100 – fadAlphaImage))/100;
fadFLIMMImageM = fadFLIMMImage .* maskImage;
fadAlphaImageM = fadAlphaImage.* maskImage;
fadT2ImageM = fadT2Image .* maskImage;
fadT1ImageM = fadT1Image .* maskImage;
fadAlphaMean = mean(fadAlphaImageM(fadAlphaImageM~=0),’omitnan’);
fadT2Mean = mean(fadT2ImageM(fadT2ImageM~=0),’omitnan’);
fadT1Mean = mean(fadT1ImageM(fadT1ImageM~=0),’omitnan’);
fadFLIMMMean = mean(fadFLIMMImageM(fadFLIMMImageM~=0),’omitnan’);
set(handles.edit7 , ‘String’, num2str(fadT1Mean));
set(handles.edit8 , ‘String’, num2str(fadT2Mean));
set(handles.edit9 , ‘String’, num2str(fadAlphaMean));
set(handles.edit10 , ‘String’, num2str(fadFLIMMMean));
axes(handles.axes10);
imagesc(fadT1ImageM)
colormap(gray)
colorbar
axes(handles.axes11);
imagesc(fadT2ImageM)
colormap(gray)
colorbar
axes(handles.axes12);
imagesc(fadAlphaImageM)
colormap(gray)
colorbar
function edit7_Callback(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit7 as text
% str2double(get(hObject,’String’)) returns contents of edit7 as a double
% — Executes during object creation, after setting all properties.
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit8_Callback(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit8 as text
% str2double(get(hObject,’String’)) returns contents of edit8 as a double
% — Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit9_Callback(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit9 as text
% str2double(get(hObject,’String’)) returns contents of edit9 as a double
% — Executes during object creation, after setting all properties.
function edit9_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit10_Callback(hObject, eventdata, handles)
% hObject handle to edit10 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit10 as text
% str2double(get(hObject,’String’)) returns contents of edit10 as a double
% — Executes during object creation, after setting all properties.
function edit10_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit10 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit11_Callback(~, eventdata, handles)
% hObject handle to edit11 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit11 as text
% str2double(get(hObject,’String’)) returns contents of edit11 as a double
% — Executes during object creation, after setting all properties.
function edit11_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit11 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit12_Callback(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit12 as text
% str2double(get(hObject,’String’)) returns contents of edit12 as a double
% — Executes during object creation, after setting all properties.
function edit12_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit13_Callback(hObject, eventdata, handles)
% hObject handle to edit13 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit13 as text
% str2double(get(hObject,’String’)) returns contents of edit13 as a double
% — Executes during object creation, after setting all properties.
function edit13_CreateFcn(hObject, ~, handles)
% hObject handle to edit13 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
%% Select the file to save
% — Executes on button press in pushbutton15.
function pushbutton15_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton15 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global saveExcelLocation;
[saveExcelName, saveExcelPath] = uigetfile(‘*.xlsx’,’Pick an excel file’);
saveExcelLocation = strcat(saveExcelPath,saveExcelName);
set(handles.edit14 , ‘String’, saveExcelLocation);
function edit14_Callback(hObject, eventdata, handles)
% hObject handle to edit14 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit14 as text
% str2double(get(hObject,’String’)) returns contents of edit14 as a double
% — Executes during object creation, after setting all properties.
function edit14_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit14 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
%% Save the data to the excel file
% — Executes on button press in pushbutton16.
function pushbutton16_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton16 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT1Mean;
global nadhT2Mean;
global nadhAlphaMean;
global nadhFLIMMMean;
global fadT1Mean;
global fadT2Mean;
global fadAlphaMean;
global fadFLIMMMean;
global redoxRatio;
global nadhThreshold;
global saveExcelLocation;
global nadhImageName ;
global fadImageName;
nadhFlimData = [nadhThreshold,redoxRatio,nadhT1Mean,nadhT2Mean,nadhAlphaMean,nadhFLIMMMean];
fadFlimData = [fadT1Mean,fadT2Mean,fadAlphaMean,fadFLIMMMean];
excelData = xlsread(saveExcelLocation,’Sheet1′,’E:E’); % read the column of interest
lastRowNumber = length(excelData)+ 2;
nadhWriteLoc = strcat(‘C’,num2str(lastRowNumber));
nadhNameWriteLoc = strcat(‘A’,num2str(lastRowNumber));
% save NADH data to the excel file
xlswrite(saveExcelLocation,nadhFlimData,’sheet1′,nadhWriteLoc);
xlswrite(saveExcelLocation,nadhImageName,’sheet1′,nadhNameWriteLoc);
% save FAD data to the excel file
lastRowNumber = lastRowNumber + 1;
fadWriteLoc = strcat(‘E’,num2str(lastRowNumber));
fadNameWriteLoc = strcat(‘A’,num2str(lastRowNumber));
xlswrite(saveExcelLocation,fadFlimData,’sheet1′,fadWriteLoc);
xlswrite(saveExcelLocation,fadImageName,’sheet1′,fadNameWriteLoc);
% — Executes on slider movement.
function slider3_Callback(hObject, eventdata, handles)
% hObject handle to slider3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’Value’) returns position of slider
% get(hObject,’Min’) and get(hObject,’Max’) to determine range of slider
global nadhThreshold;
global maskShowImage;
global nadhTextImage
nadhThreshold = get(handles.slider3 ,’Value’);
% get the image mask
maskShowImage = nadhTextImage;
maskShowImage(maskShowImage < nadhThreshold) = 0;
set(handles.edit1 , ‘String’, num2str(nadhThreshold));
axes(handles.axes4);
imagesc(maskShowImage)
colormap(gray)
colorbar
% — Executes during object creation, after setting all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,[.9 .9 .9]);
end
function slider3_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,[.9 .9 .9]);
end
% — Executes on button press in pushbutton17.
function pushbutton17_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton17 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhFileName;
global nadhPathName;
global nadhT1Image;
% Get the location of the image
nadhT1FileName = strrep(nadhFileName,’photons’,’t1′);
nadhT1PathName = nadhPathName;
nadhT1Image = importdata(strcat(nadhT1PathName,nadhT1FileName));
nadhT1Image(nadhT1Image > 8000) = 0;
nadhT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes7);
imagesc(nadhT1Image)
colormap(gray)
colorbar
set(handles.text7 , ‘String’, nadhT1FileName);
global nadhT2Image;
% Get the location of the image
nadhT2FileName = strrep(nadhFileName,’photons’,’t2′);
nadhT2PathName = nadhPathName;
nadhT2Image = importdata(strcat(nadhT2PathName,nadhT2FileName));
nadhT2Image(nadhT2Image > 8000) = 0;
nadhT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes8);
imagesc(nadhT2Image)
colormap(gray)
colorbar
set(handles.text8 , ‘String’, nadhT2FileName);
global nadhAlphaImage;
% Get the location of the image
nadhAlphaFileName = strrep(nadhFileName,’photons’,’a1[%]’);
nadhAlphaPathName = nadhPathName;
nadhAlphaImage = importdata(strcat(nadhAlphaPathName,nadhAlphaFileName));
nadhAlphaImage(nadhAlphaImage>100) = 0;
nadhAlphaImage(nadhAlphaImage<0) = 0;
nadhAlphaImage(:,245:256) = 0;
% display the NADH image in axes7 and show the image name
axes(handles.axes9);
imagesc(nadhAlphaImage)
colormap(gray)
colorbar
set(handles.text9 , ‘String’, nadhAlphaFileName);
global fadFileName;
global fadPathName;
global fadT1Image;
% Get the location of the image
fadT1FileName = strrep(fadFileName,’photons’,’t1′);
fadT1PathName = fadPathName;
fadT1Image = importdata(strcat(fadT1PathName,fadT1FileName));
fadT1Image(fadT1Image > 8000) = 0;
fadT1Image(fadT1Image < 0) = 0;
fadT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes10);
imagesc(fadT1Image)
colormap(gray)
colorbar
set(handles.text10 , ‘String’, fadT1FileName);
global fadT2Image;
% Get the location of the image
fadT2FileName = strrep(fadFileName,’photons’,’t2′);
fadT2PathName = fadPathName;
fadT2Image = importdata(strcat(fadT2PathName,fadT2FileName));
fadT2Image(fadT2Image>8000) = 0;
fadT2Image(fadT2Image < 0) = 0;
fadT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes11);
imagesc(fadT2Image)
colormap(gray)
colorbar
set(handles.text11 , ‘String’, fadT2FileName)
global fadAlphaImage;
% Get the location of the image
fadAplhaFileName = strrep(fadFileName,’photons’,’a1[%]’);
fadAlphaPathName = fadPathName;
fadAlphaImage = importdata(strcat(fadAlphaPathName,fadAplhaFileName));
fadAlphaImage(fadAlphaImage>100) = 0;
fadAlphaImage(fadAlphaImage<0) = 0;
fadAlphaImage(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes12);
imagesc(fadAlphaImage)
colormap(gray)
colorbar
set(handles.text12 , ‘String’, fadAplhaFileName);function varargout = FLIM_processing(varargin)
% FLIM_PROCESSING MATLAB code for FLIM_processing.fig
% FLIM_PROCESSING, by itself, creates a new FLIM_PROCESSING or raises the existing
% singleton*.
%
% H = FLIM_PROCESSING returns the handle to a new FLIM_PROCESSING or the handle to
% the existing singleton*.
%
% FLIM_processing(‘CALLBACK’,hObject,eventData,handles,…) calls the local
% function named CALLBACK in FLIM_processing.M with the given input arguments.
%
% FLIM_processing(‘Property’,’Value’,…) creates a new FLIM_processing or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before FLIM_processing_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to FLIM_processing_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE’s Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help FLIM_processing
% Last Modified by GUIDE v2.5 13-Apr-2021 19:57:16
% Begin initialization code – DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @FLIM_processing_OpeningFcn, …
‘gui_OutputFcn’, @FLIM_processing_OutputFcn, …
‘gui_LayoutFcn’, [] , …
‘gui_Callback’, []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code – DO NOT EDIT
% — Executes just before FLIM_processing is made visible.
function FLIM_processing_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to FLIM_processing (see VARARGIN)
% Choose default command line output for FLIM_processing
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes FLIM_processing wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% — Outputs from this function are returned to the command line.
function varargout = FLIM_processing_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
%% Get the NADH Image Button
% — Executes on button press in pushbutton1.
function read_NADH_intensity_Callback(~, ~, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global maskShowImage;
global nadhImageName;
global nadhFileName;
global nadhPathName;
% Get the location of the image
[nadhFileName, nadhPathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhTextImage = importdata(strcat(nadhPathName,nadhFileName));
nadhTextImage(nadhTextImage > 1000) = 0;
nadhTextImage(:,245:256)=0;
maskShowImage = nadhTextImage;
nadhImageName = {nadhFileName,’NADH’};
% display the NADH image in axes1
maxIntensityValue = max(nadhTextImage(:));
minIntensityValue = min(nadhTextImage(:));
set(handles.slider3,’Max’,maxIntensityValue);
set(handles.slider3,’Min’,minIntensityValue);
set(handles.text19,’String’,num2str(minIntensityValue));
set(handles.text20,’String’,num2str(maxIntensityValue));
set(handles.text23,’String’,nadhFileName);
axes(handles.axes1);
imagesc(nadhTextImage)
colormap(gray)
colorbar
axes(handles.axes4);
imagesc(maskShowImage)
colormap(gray)
colorbar
%% Get the Mask Image Button
% — Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global maskImage;
global nadhThreshold;
% get the image mask
maskImage = nadhTextImage;
nadhThreshold = get(handles.edit1,’String’);
nadhThreshold = str2double( nadhThreshold );
maskImage(maskImage < nadhThreshold) = 0;
maskImage(maskImage~=0) = 1;
% display the mask Image axes4
axes(handles.axes4);
imagesc(maskImage)
colormap(gray)
colorbar
%% read FAD intensity image
% — Executes on button press in readFADIntensity.
function read_FAD_intensity_Callback(hObject, eventdata, handles)
% hObject handle to readFADIntensity (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadTextImage
% Get the location of the image
global fadImageName;
global fadFileName;
global fadPathName;
[fadFileName, fadPathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadImageName = {fadFileName,’FAD’};
fadTextImage = importdata(strcat(fadPathName,fadFileName));
fadTextImage(fadTextImage > 1000) = 0;
fadTextImage(:,245:256)=0;
% display the NADH image in axes1
set(handles.text24,’String’,fadFileName);
axes(handles.axes2);
imagesc(fadTextImage)
colormap(gray)
colorbar
%% Read NADH T1 Image
% — Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT1Image;
% Get the location of the image
[nadhT1FileName, nadhT1PathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhT1Image = importdata(strcat(nadhT1PathName,nadhT1FileName));
nadhT1Image(nadhT1Image > 8000) = 0;
nadhT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes7);
imagesc(nadhT1Image)
colormap(gray)
colorbar
set(handles.text7 , ‘String’, nadhT1FileName);
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit1 as text
% str2double(get(hObject,’String’)) returns contents of edit1 as a double
% — Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
% — Executes during object deletion, before destroying properties.
function edit1_DeleteFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%% Calculate Redox Ratio Button
% — Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global fadTextImage;
global redoxRatioImage;
redoxRatioImage = nadhTextImage./(nadhTextImage + fadTextImage);
axes(handles.axes6);
imagesc(redoxRatioImage)
colormap(gray)
colorbar
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit2 as text
% str2double(get(hObject,’String’)) returns contents of edit2 as a double
% — Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
% — Executes on button press in pushbutton6.
function pushbutton6_Callback(~, ~, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global fadTextImage;
global redoxRatioImage;
global maskImage;
global redoxRatio;
nadhIntensityImage = nadhTextImage.* maskImage;
fadIntensityImage = fadTextImage.* maskImage;
axes(handles.axes1);
imagesc(nadhIntensityImage)
colormap(gray)
colorbar
axes(handles.axes2);
imagesc(fadIntensityImage)
colormap(gray)
colorbar
redoxRatioIntensityImage = redoxRatioImage.* maskImage;
axes(handles.axes6);
imagesc(redoxRatioIntensityImage)
colormap(gray)
colorbar
redoxRatio = mean(redoxRatioIntensityImage(redoxRatioIntensityImage~=0),’omitnan’);
set(handles.edit2 , ‘String’, num2str(redoxRatio));
%% Read NADH T2 Image and display
% — Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT2Image;
% Get the location of the image
[nadhT2FileName, nadhT2PathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhT2Image = importdata(strcat(nadhT2PathName,nadhT2FileName));
nadhT2Image(nadhT2Image > 8000) = 0;
nadhT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes8);
imagesc(nadhT2Image)
colormap(gray)
colorbar
set(handles.text8 , ‘String’, nadhT2FileName);
%% Read NADH alpha Image and display
% — Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhAlphaImage;
% Get the location of the image
[nadhAlphaFileName, nadhAlphaPathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhAlphaImage = importdata(strcat(nadhAlphaPathName,nadhAlphaFileName));
nadhAlphaImage(nadhAlphaImage>100) = 0;
nadhAlphaImage(nadhAlphaImage<0) = 0;
nadhAlphaImage(:,245:256) = 0;
% display the NADH image in axes7 and show the image name
axes(handles.axes9);
imagesc(nadhAlphaImage)
colormap(gray)
colorbar
set(handles.text9 , ‘String’, nadhAlphaFileName);
%% Calculate NADH FLIM mean
% — Executes on button press in pushbutton9.
function pushbutton9_Callback(~, eventdata, handles)
% hObject handle to pushbutton9 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT1Image;
global nadhT2Image;
global nadhAlphaImage;
global maskImage;
global nadhT1Mean;
global nadhT2Mean;
global nadhAlphaMean;
global nadhFLIMMMean;
nadhFLIMMImage = (nadhT1Image.* nadhAlphaImage + nadhT2Image.*(100 – nadhAlphaImage))/100;
nadhFLIMMImageM = nadhFLIMMImage .* maskImage;
nadhAlphaImageM = nadhAlphaImage.* maskImage;
nadhT2ImageM = nadhT2Image .* maskImage;
nadhT1ImageM = nadhT1Image .* maskImage;
nadhAlphaMean = mean(nadhAlphaImageM(nadhAlphaImageM~=0),’omitnan’);
nadhT2Mean = mean(nadhT2ImageM(nadhT2ImageM~=0),’omitnan’);
nadhT1Mean = mean(nadhT1ImageM(nadhT1ImageM~=0),’omitnan’);
nadhFLIMMMean = mean(nadhFLIMMImageM(nadhFLIMMImageM~=0),’omitnan’);
set(handles.edit3 , ‘String’, num2str(nadhT1Mean));
set(handles.edit4 , ‘String’, num2str(nadhT2Mean));
set(handles.edit5 , ‘String’, num2str(nadhAlphaMean));
set(handles.edit6 , ‘String’, num2str(nadhFLIMMMean));
axes(handles.axes7);
imagesc(nadhT1ImageM)
colormap(gray)
colorbar
axes(handles.axes8);
imagesc(nadhT2ImageM)
colormap(gray)
colorbar
axes(handles.axes9);
imagesc(nadhAlphaImageM)
colormap(gray)
colorbar
function edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit3 as text
% str2double(get(hObject,’String’)) returns contents of edit3 as a double
% — Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit4_Callback(hObject, ~, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit4 as text
% str2double(get(hObject,’String’)) returns contents of edit4 as a double
% — Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit5_Callback(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit5 as text
% str2double(get(hObject,’String’)) returns contents of edit5 as a double
% — Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit6_Callback(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit6 as text
% str2double(get(hObject,’String’)) returns contents of edit6 as a double
% — Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
%% Read FAD T1 image and display
% — Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton10 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadT1Image;
% Get the location of the image
[fadT1FileName, fadT1PathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadT1Image = importdata(strcat(fadT1PathName,fadT1FileName));
fadT1Image(fadT1Image > 8000) = 0;
fadT1Image(fadT1Image < 0) = 0;
fadT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes10);
imagesc(fadT1Image)
colormap(gray)
colorbar
set(handles.text10 , ‘String’, fadT1FileName);
% — Executes on button press in pushbutton11.
function pushbutton11_Callback(hObject, ~, handles)
% hObject handle to pushbutton11 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadT2Image;
% Get the location of the image
[fadT2FileName, fadT2PathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadT2Image = importdata(strcat(fadT2PathName,fadT2FileName));
fadT2Image(fadT2Image>8000) = 0;
fadT2Image(fadT2Image < 0) = 0;
fadT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes11);
imagesc(fadT2Image)
colormap(gray)
colorbar
set(handles.text11 , ‘String’, fadT2FileName);
% — Executes on button press in pushbutton12.
function pushbutton12_Callback(~, ~, handles)
% hObject handle to pushbutton12 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadAlphaImage;
% Get the location of the image
[fadAplhaFileName, fadAlphaPathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadAlphaImage = importdata(strcat(fadAlphaPathName,fadAplhaFileName));
fadAlphaImage(fadAlphaImage>100) = 0;
fadAlphaImage(fadAlphaImage<0) = 0;
fadAlphaImage(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes12);
imagesc(fadAlphaImage)
colormap(gray)
colorbar
set(handles.text12 , ‘String’, fadAplhaFileName);
% — Executes on button press in pushbutton13.
function pushbutton13_Callback(~, eventdata, handles)
% hObject handle to pushbutton13 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadT1Image;
global fadT2Image;
global fadAlphaImage;
global maskImage
global fadT1Mean;
global fadT2Mean;
global fadAlphaMean;
global fadFLIMMMean;
fadFLIMMImage = (fadT1Image.* fadAlphaImage + fadT2Image.*(100 – fadAlphaImage))/100;
fadFLIMMImageM = fadFLIMMImage .* maskImage;
fadAlphaImageM = fadAlphaImage.* maskImage;
fadT2ImageM = fadT2Image .* maskImage;
fadT1ImageM = fadT1Image .* maskImage;
fadAlphaMean = mean(fadAlphaImageM(fadAlphaImageM~=0),’omitnan’);
fadT2Mean = mean(fadT2ImageM(fadT2ImageM~=0),’omitnan’);
fadT1Mean = mean(fadT1ImageM(fadT1ImageM~=0),’omitnan’);
fadFLIMMMean = mean(fadFLIMMImageM(fadFLIMMImageM~=0),’omitnan’);
set(handles.edit7 , ‘String’, num2str(fadT1Mean));
set(handles.edit8 , ‘String’, num2str(fadT2Mean));
set(handles.edit9 , ‘String’, num2str(fadAlphaMean));
set(handles.edit10 , ‘String’, num2str(fadFLIMMMean));
axes(handles.axes10);
imagesc(fadT1ImageM)
colormap(gray)
colorbar
axes(handles.axes11);
imagesc(fadT2ImageM)
colormap(gray)
colorbar
axes(handles.axes12);
imagesc(fadAlphaImageM)
colormap(gray)
colorbar
function edit7_Callback(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit7 as text
% str2double(get(hObject,’String’)) returns contents of edit7 as a double
% — Executes during object creation, after setting all properties.
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit8_Callback(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit8 as text
% str2double(get(hObject,’String’)) returns contents of edit8 as a double
% — Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit9_Callback(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit9 as text
% str2double(get(hObject,’String’)) returns contents of edit9 as a double
% — Executes during object creation, after setting all properties.
function edit9_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit10_Callback(hObject, eventdata, handles)
% hObject handle to edit10 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit10 as text
% str2double(get(hObject,’String’)) returns contents of edit10 as a double
% — Executes during object creation, after setting all properties.
function edit10_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit10 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit11_Callback(~, eventdata, handles)
% hObject handle to edit11 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit11 as text
% str2double(get(hObject,’String’)) returns contents of edit11 as a double
% — Executes during object creation, after setting all properties.
function edit11_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit11 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit12_Callback(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit12 as text
% str2double(get(hObject,’String’)) returns contents of edit12 as a double
% — Executes during object creation, after setting all properties.
function edit12_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit13_Callback(hObject, eventdata, handles)
% hObject handle to edit13 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit13 as text
% str2double(get(hObject,’String’)) returns contents of edit13 as a double
% — Executes during object creation, after setting all properties.
function edit13_CreateFcn(hObject, ~, handles)
% hObject handle to edit13 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
%% Select the file to save
% — Executes on button press in pushbutton15.
function pushbutton15_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton15 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global saveExcelLocation;
[saveExcelName, saveExcelPath] = uigetfile(‘*.xlsx’,’Pick an excel file’);
saveExcelLocation = strcat(saveExcelPath,saveExcelName);
set(handles.edit14 , ‘String’, saveExcelLocation);
function edit14_Callback(hObject, eventdata, handles)
% hObject handle to edit14 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit14 as text
% str2double(get(hObject,’String’)) returns contents of edit14 as a double
% — Executes during object creation, after setting all properties.
function edit14_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit14 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
%% Save the data to the excel file
% — Executes on button press in pushbutton16.
function pushbutton16_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton16 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT1Mean;
global nadhT2Mean;
global nadhAlphaMean;
global nadhFLIMMMean;
global fadT1Mean;
global fadT2Mean;
global fadAlphaMean;
global fadFLIMMMean;
global redoxRatio;
global nadhThreshold;
global saveExcelLocation;
global nadhImageName ;
global fadImageName;
nadhFlimData = [nadhThreshold,redoxRatio,nadhT1Mean,nadhT2Mean,nadhAlphaMean,nadhFLIMMMean];
fadFlimData = [fadT1Mean,fadT2Mean,fadAlphaMean,fadFLIMMMean];
excelData = xlsread(saveExcelLocation,’Sheet1′,’E:E’); % read the column of interest
lastRowNumber = length(excelData)+ 2;
nadhWriteLoc = strcat(‘C’,num2str(lastRowNumber));
nadhNameWriteLoc = strcat(‘A’,num2str(lastRowNumber));
% save NADH data to the excel file
xlswrite(saveExcelLocation,nadhFlimData,’sheet1′,nadhWriteLoc);
xlswrite(saveExcelLocation,nadhImageName,’sheet1′,nadhNameWriteLoc);
% save FAD data to the excel file
lastRowNumber = lastRowNumber + 1;
fadWriteLoc = strcat(‘E’,num2str(lastRowNumber));
fadNameWriteLoc = strcat(‘A’,num2str(lastRowNumber));
xlswrite(saveExcelLocation,fadFlimData,’sheet1′,fadWriteLoc);
xlswrite(saveExcelLocation,fadImageName,’sheet1′,fadNameWriteLoc);
% — Executes on slider movement.
function slider3_Callback(hObject, eventdata, handles)
% hObject handle to slider3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’Value’) returns position of slider
% get(hObject,’Min’) and get(hObject,’Max’) to determine range of slider
global nadhThreshold;
global maskShowImage;
global nadhTextImage
nadhThreshold = get(handles.slider3 ,’Value’);
% get the image mask
maskShowImage = nadhTextImage;
maskShowImage(maskShowImage < nadhThreshold) = 0;
set(handles.edit1 , ‘String’, num2str(nadhThreshold));
axes(handles.axes4);
imagesc(maskShowImage)
colormap(gray)
colorbar
% — Executes during object creation, after setting all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,[.9 .9 .9]);
end
function slider3_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,[.9 .9 .9]);
end
% — Executes on button press in pushbutton17.
function pushbutton17_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton17 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhFileName;
global nadhPathName;
global nadhT1Image;
% Get the location of the image
nadhT1FileName = strrep(nadhFileName,’photons’,’t1′);
nadhT1PathName = nadhPathName;
nadhT1Image = importdata(strcat(nadhT1PathName,nadhT1FileName));
nadhT1Image(nadhT1Image > 8000) = 0;
nadhT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes7);
imagesc(nadhT1Image)
colormap(gray)
colorbar
set(handles.text7 , ‘String’, nadhT1FileName);
global nadhT2Image;
% Get the location of the image
nadhT2FileName = strrep(nadhFileName,’photons’,’t2′);
nadhT2PathName = nadhPathName;
nadhT2Image = importdata(strcat(nadhT2PathName,nadhT2FileName));
nadhT2Image(nadhT2Image > 8000) = 0;
nadhT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes8);
imagesc(nadhT2Image)
colormap(gray)
colorbar
set(handles.text8 , ‘String’, nadhT2FileName);
global nadhAlphaImage;
% Get the location of the image
nadhAlphaFileName = strrep(nadhFileName,’photons’,’a1[%]’);
nadhAlphaPathName = nadhPathName;
nadhAlphaImage = importdata(strcat(nadhAlphaPathName,nadhAlphaFileName));
nadhAlphaImage(nadhAlphaImage>100) = 0;
nadhAlphaImage(nadhAlphaImage<0) = 0;
nadhAlphaImage(:,245:256) = 0;
% display the NADH image in axes7 and show the image name
axes(handles.axes9);
imagesc(nadhAlphaImage)
colormap(gray)
colorbar
set(handles.text9 , ‘String’, nadhAlphaFileName);
global fadFileName;
global fadPathName;
global fadT1Image;
% Get the location of the image
fadT1FileName = strrep(fadFileName,’photons’,’t1′);
fadT1PathName = fadPathName;
fadT1Image = importdata(strcat(fadT1PathName,fadT1FileName));
fadT1Image(fadT1Image > 8000) = 0;
fadT1Image(fadT1Image < 0) = 0;
fadT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes10);
imagesc(fadT1Image)
colormap(gray)
colorbar
set(handles.text10 , ‘String’, fadT1FileName);
global fadT2Image;
% Get the location of the image
fadT2FileName = strrep(fadFileName,’photons’,’t2′);
fadT2PathName = fadPathName;
fadT2Image = importdata(strcat(fadT2PathName,fadT2FileName));
fadT2Image(fadT2Image>8000) = 0;
fadT2Image(fadT2Image < 0) = 0;
fadT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes11);
imagesc(fadT2Image)
colormap(gray)
colorbar
set(handles.text11 , ‘String’, fadT2FileName)
global fadAlphaImage;
% Get the location of the image
fadAplhaFileName = strrep(fadFileName,’photons’,’a1[%]’);
fadAlphaPathName = fadPathName;
fadAlphaImage = importdata(strcat(fadAlphaPathName,fadAplhaFileName));
fadAlphaImage(fadAlphaImage>100) = 0;
fadAlphaImage(fadAlphaImage<0) = 0;
fadAlphaImage(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes12);
imagesc(fadAlphaImage)
colormap(gray)
colorbar
set(handles.text12 , ‘String’, fadAplhaFileName); function varargout = FLIM_processing(varargin)
% FLIM_PROCESSING MATLAB code for FLIM_processing.fig
% FLIM_PROCESSING, by itself, creates a new FLIM_PROCESSING or raises the existing
% singleton*.
%
% H = FLIM_PROCESSING returns the handle to a new FLIM_PROCESSING or the handle to
% the existing singleton*.
%
% FLIM_processing(‘CALLBACK’,hObject,eventData,handles,…) calls the local
% function named CALLBACK in FLIM_processing.M with the given input arguments.
%
% FLIM_processing(‘Property’,’Value’,…) creates a new FLIM_processing or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before FLIM_processing_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to FLIM_processing_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE’s Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help FLIM_processing
% Last Modified by GUIDE v2.5 13-Apr-2021 19:57:16
% Begin initialization code – DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @FLIM_processing_OpeningFcn, …
‘gui_OutputFcn’, @FLIM_processing_OutputFcn, …
‘gui_LayoutFcn’, [] , …
‘gui_Callback’, []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code – DO NOT EDIT
% — Executes just before FLIM_processing is made visible.
function FLIM_processing_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to FLIM_processing (see VARARGIN)
% Choose default command line output for FLIM_processing
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes FLIM_processing wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% — Outputs from this function are returned to the command line.
function varargout = FLIM_processing_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
%% Get the NADH Image Button
% — Executes on button press in pushbutton1.
function read_NADH_intensity_Callback(~, ~, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global maskShowImage;
global nadhImageName;
global nadhFileName;
global nadhPathName;
% Get the location of the image
[nadhFileName, nadhPathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhTextImage = importdata(strcat(nadhPathName,nadhFileName));
nadhTextImage(nadhTextImage > 1000) = 0;
nadhTextImage(:,245:256)=0;
maskShowImage = nadhTextImage;
nadhImageName = {nadhFileName,’NADH’};
% display the NADH image in axes1
maxIntensityValue = max(nadhTextImage(:));
minIntensityValue = min(nadhTextImage(:));
set(handles.slider3,’Max’,maxIntensityValue);
set(handles.slider3,’Min’,minIntensityValue);
set(handles.text19,’String’,num2str(minIntensityValue));
set(handles.text20,’String’,num2str(maxIntensityValue));
set(handles.text23,’String’,nadhFileName);
axes(handles.axes1);
imagesc(nadhTextImage)
colormap(gray)
colorbar
axes(handles.axes4);
imagesc(maskShowImage)
colormap(gray)
colorbar
%% Get the Mask Image Button
% — Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global maskImage;
global nadhThreshold;
% get the image mask
maskImage = nadhTextImage;
nadhThreshold = get(handles.edit1,’String’);
nadhThreshold = str2double( nadhThreshold );
maskImage(maskImage < nadhThreshold) = 0;
maskImage(maskImage~=0) = 1;
% display the mask Image axes4
axes(handles.axes4);
imagesc(maskImage)
colormap(gray)
colorbar
%% read FAD intensity image
% — Executes on button press in readFADIntensity.
function read_FAD_intensity_Callback(hObject, eventdata, handles)
% hObject handle to readFADIntensity (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadTextImage
% Get the location of the image
global fadImageName;
global fadFileName;
global fadPathName;
[fadFileName, fadPathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadImageName = {fadFileName,’FAD’};
fadTextImage = importdata(strcat(fadPathName,fadFileName));
fadTextImage(fadTextImage > 1000) = 0;
fadTextImage(:,245:256)=0;
% display the NADH image in axes1
set(handles.text24,’String’,fadFileName);
axes(handles.axes2);
imagesc(fadTextImage)
colormap(gray)
colorbar
%% Read NADH T1 Image
% — Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT1Image;
% Get the location of the image
[nadhT1FileName, nadhT1PathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhT1Image = importdata(strcat(nadhT1PathName,nadhT1FileName));
nadhT1Image(nadhT1Image > 8000) = 0;
nadhT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes7);
imagesc(nadhT1Image)
colormap(gray)
colorbar
set(handles.text7 , ‘String’, nadhT1FileName);
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit1 as text
% str2double(get(hObject,’String’)) returns contents of edit1 as a double
% — Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
% — Executes during object deletion, before destroying properties.
function edit1_DeleteFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%% Calculate Redox Ratio Button
% — Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global fadTextImage;
global redoxRatioImage;
redoxRatioImage = nadhTextImage./(nadhTextImage + fadTextImage);
axes(handles.axes6);
imagesc(redoxRatioImage)
colormap(gray)
colorbar
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit2 as text
% str2double(get(hObject,’String’)) returns contents of edit2 as a double
% — Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
% — Executes on button press in pushbutton6.
function pushbutton6_Callback(~, ~, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhTextImage;
global fadTextImage;
global redoxRatioImage;
global maskImage;
global redoxRatio;
nadhIntensityImage = nadhTextImage.* maskImage;
fadIntensityImage = fadTextImage.* maskImage;
axes(handles.axes1);
imagesc(nadhIntensityImage)
colormap(gray)
colorbar
axes(handles.axes2);
imagesc(fadIntensityImage)
colormap(gray)
colorbar
redoxRatioIntensityImage = redoxRatioImage.* maskImage;
axes(handles.axes6);
imagesc(redoxRatioIntensityImage)
colormap(gray)
colorbar
redoxRatio = mean(redoxRatioIntensityImage(redoxRatioIntensityImage~=0),’omitnan’);
set(handles.edit2 , ‘String’, num2str(redoxRatio));
%% Read NADH T2 Image and display
% — Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT2Image;
% Get the location of the image
[nadhT2FileName, nadhT2PathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhT2Image = importdata(strcat(nadhT2PathName,nadhT2FileName));
nadhT2Image(nadhT2Image > 8000) = 0;
nadhT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes8);
imagesc(nadhT2Image)
colormap(gray)
colorbar
set(handles.text8 , ‘String’, nadhT2FileName);
%% Read NADH alpha Image and display
% — Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhAlphaImage;
% Get the location of the image
[nadhAlphaFileName, nadhAlphaPathName] = uigetfile(‘*.asc’,’Pick an Image’);
nadhAlphaImage = importdata(strcat(nadhAlphaPathName,nadhAlphaFileName));
nadhAlphaImage(nadhAlphaImage>100) = 0;
nadhAlphaImage(nadhAlphaImage<0) = 0;
nadhAlphaImage(:,245:256) = 0;
% display the NADH image in axes7 and show the image name
axes(handles.axes9);
imagesc(nadhAlphaImage)
colormap(gray)
colorbar
set(handles.text9 , ‘String’, nadhAlphaFileName);
%% Calculate NADH FLIM mean
% — Executes on button press in pushbutton9.
function pushbutton9_Callback(~, eventdata, handles)
% hObject handle to pushbutton9 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT1Image;
global nadhT2Image;
global nadhAlphaImage;
global maskImage;
global nadhT1Mean;
global nadhT2Mean;
global nadhAlphaMean;
global nadhFLIMMMean;
nadhFLIMMImage = (nadhT1Image.* nadhAlphaImage + nadhT2Image.*(100 – nadhAlphaImage))/100;
nadhFLIMMImageM = nadhFLIMMImage .* maskImage;
nadhAlphaImageM = nadhAlphaImage.* maskImage;
nadhT2ImageM = nadhT2Image .* maskImage;
nadhT1ImageM = nadhT1Image .* maskImage;
nadhAlphaMean = mean(nadhAlphaImageM(nadhAlphaImageM~=0),’omitnan’);
nadhT2Mean = mean(nadhT2ImageM(nadhT2ImageM~=0),’omitnan’);
nadhT1Mean = mean(nadhT1ImageM(nadhT1ImageM~=0),’omitnan’);
nadhFLIMMMean = mean(nadhFLIMMImageM(nadhFLIMMImageM~=0),’omitnan’);
set(handles.edit3 , ‘String’, num2str(nadhT1Mean));
set(handles.edit4 , ‘String’, num2str(nadhT2Mean));
set(handles.edit5 , ‘String’, num2str(nadhAlphaMean));
set(handles.edit6 , ‘String’, num2str(nadhFLIMMMean));
axes(handles.axes7);
imagesc(nadhT1ImageM)
colormap(gray)
colorbar
axes(handles.axes8);
imagesc(nadhT2ImageM)
colormap(gray)
colorbar
axes(handles.axes9);
imagesc(nadhAlphaImageM)
colormap(gray)
colorbar
function edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit3 as text
% str2double(get(hObject,’String’)) returns contents of edit3 as a double
% — Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit4_Callback(hObject, ~, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit4 as text
% str2double(get(hObject,’String’)) returns contents of edit4 as a double
% — Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit5_Callback(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit5 as text
% str2double(get(hObject,’String’)) returns contents of edit5 as a double
% — Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit6_Callback(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit6 as text
% str2double(get(hObject,’String’)) returns contents of edit6 as a double
% — Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
%% Read FAD T1 image and display
% — Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton10 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadT1Image;
% Get the location of the image
[fadT1FileName, fadT1PathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadT1Image = importdata(strcat(fadT1PathName,fadT1FileName));
fadT1Image(fadT1Image > 8000) = 0;
fadT1Image(fadT1Image < 0) = 0;
fadT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes10);
imagesc(fadT1Image)
colormap(gray)
colorbar
set(handles.text10 , ‘String’, fadT1FileName);
% — Executes on button press in pushbutton11.
function pushbutton11_Callback(hObject, ~, handles)
% hObject handle to pushbutton11 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadT2Image;
% Get the location of the image
[fadT2FileName, fadT2PathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadT2Image = importdata(strcat(fadT2PathName,fadT2FileName));
fadT2Image(fadT2Image>8000) = 0;
fadT2Image(fadT2Image < 0) = 0;
fadT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes11);
imagesc(fadT2Image)
colormap(gray)
colorbar
set(handles.text11 , ‘String’, fadT2FileName);
% — Executes on button press in pushbutton12.
function pushbutton12_Callback(~, ~, handles)
% hObject handle to pushbutton12 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadAlphaImage;
% Get the location of the image
[fadAplhaFileName, fadAlphaPathName] = uigetfile(‘*.asc’,’Pick an Image’);
fadAlphaImage = importdata(strcat(fadAlphaPathName,fadAplhaFileName));
fadAlphaImage(fadAlphaImage>100) = 0;
fadAlphaImage(fadAlphaImage<0) = 0;
fadAlphaImage(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes12);
imagesc(fadAlphaImage)
colormap(gray)
colorbar
set(handles.text12 , ‘String’, fadAplhaFileName);
% — Executes on button press in pushbutton13.
function pushbutton13_Callback(~, eventdata, handles)
% hObject handle to pushbutton13 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fadT1Image;
global fadT2Image;
global fadAlphaImage;
global maskImage
global fadT1Mean;
global fadT2Mean;
global fadAlphaMean;
global fadFLIMMMean;
fadFLIMMImage = (fadT1Image.* fadAlphaImage + fadT2Image.*(100 – fadAlphaImage))/100;
fadFLIMMImageM = fadFLIMMImage .* maskImage;
fadAlphaImageM = fadAlphaImage.* maskImage;
fadT2ImageM = fadT2Image .* maskImage;
fadT1ImageM = fadT1Image .* maskImage;
fadAlphaMean = mean(fadAlphaImageM(fadAlphaImageM~=0),’omitnan’);
fadT2Mean = mean(fadT2ImageM(fadT2ImageM~=0),’omitnan’);
fadT1Mean = mean(fadT1ImageM(fadT1ImageM~=0),’omitnan’);
fadFLIMMMean = mean(fadFLIMMImageM(fadFLIMMImageM~=0),’omitnan’);
set(handles.edit7 , ‘String’, num2str(fadT1Mean));
set(handles.edit8 , ‘String’, num2str(fadT2Mean));
set(handles.edit9 , ‘String’, num2str(fadAlphaMean));
set(handles.edit10 , ‘String’, num2str(fadFLIMMMean));
axes(handles.axes10);
imagesc(fadT1ImageM)
colormap(gray)
colorbar
axes(handles.axes11);
imagesc(fadT2ImageM)
colormap(gray)
colorbar
axes(handles.axes12);
imagesc(fadAlphaImageM)
colormap(gray)
colorbar
function edit7_Callback(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit7 as text
% str2double(get(hObject,’String’)) returns contents of edit7 as a double
% — Executes during object creation, after setting all properties.
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit8_Callback(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit8 as text
% str2double(get(hObject,’String’)) returns contents of edit8 as a double
% — Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit9_Callback(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit9 as text
% str2double(get(hObject,’String’)) returns contents of edit9 as a double
% — Executes during object creation, after setting all properties.
function edit9_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit10_Callback(hObject, eventdata, handles)
% hObject handle to edit10 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit10 as text
% str2double(get(hObject,’String’)) returns contents of edit10 as a double
% — Executes during object creation, after setting all properties.
function edit10_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit10 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit11_Callback(~, eventdata, handles)
% hObject handle to edit11 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit11 as text
% str2double(get(hObject,’String’)) returns contents of edit11 as a double
% — Executes during object creation, after setting all properties.
function edit11_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit11 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit12_Callback(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit12 as text
% str2double(get(hObject,’String’)) returns contents of edit12 as a double
% — Executes during object creation, after setting all properties.
function edit12_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
function edit13_Callback(hObject, eventdata, handles)
% hObject handle to edit13 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit13 as text
% str2double(get(hObject,’String’)) returns contents of edit13 as a double
% — Executes during object creation, after setting all properties.
function edit13_CreateFcn(hObject, ~, handles)
% hObject handle to edit13 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
%% Select the file to save
% — Executes on button press in pushbutton15.
function pushbutton15_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton15 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global saveExcelLocation;
[saveExcelName, saveExcelPath] = uigetfile(‘*.xlsx’,’Pick an excel file’);
saveExcelLocation = strcat(saveExcelPath,saveExcelName);
set(handles.edit14 , ‘String’, saveExcelLocation);
function edit14_Callback(hObject, eventdata, handles)
% hObject handle to edit14 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’String’) returns contents of edit14 as text
% str2double(get(hObject,’String’)) returns contents of edit14 as a double
% — Executes during object creation, after setting all properties.
function edit14_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit14 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,’white’);
end
%% Save the data to the excel file
% — Executes on button press in pushbutton16.
function pushbutton16_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton16 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhT1Mean;
global nadhT2Mean;
global nadhAlphaMean;
global nadhFLIMMMean;
global fadT1Mean;
global fadT2Mean;
global fadAlphaMean;
global fadFLIMMMean;
global redoxRatio;
global nadhThreshold;
global saveExcelLocation;
global nadhImageName ;
global fadImageName;
nadhFlimData = [nadhThreshold,redoxRatio,nadhT1Mean,nadhT2Mean,nadhAlphaMean,nadhFLIMMMean];
fadFlimData = [fadT1Mean,fadT2Mean,fadAlphaMean,fadFLIMMMean];
excelData = xlsread(saveExcelLocation,’Sheet1′,’E:E’); % read the column of interest
lastRowNumber = length(excelData)+ 2;
nadhWriteLoc = strcat(‘C’,num2str(lastRowNumber));
nadhNameWriteLoc = strcat(‘A’,num2str(lastRowNumber));
% save NADH data to the excel file
xlswrite(saveExcelLocation,nadhFlimData,’sheet1′,nadhWriteLoc);
xlswrite(saveExcelLocation,nadhImageName,’sheet1′,nadhNameWriteLoc);
% save FAD data to the excel file
lastRowNumber = lastRowNumber + 1;
fadWriteLoc = strcat(‘E’,num2str(lastRowNumber));
fadNameWriteLoc = strcat(‘A’,num2str(lastRowNumber));
xlswrite(saveExcelLocation,fadFlimData,’sheet1′,fadWriteLoc);
xlswrite(saveExcelLocation,fadImageName,’sheet1′,fadNameWriteLoc);
% — Executes on slider movement.
function slider3_Callback(hObject, eventdata, handles)
% hObject handle to slider3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,’Value’) returns position of slider
% get(hObject,’Min’) and get(hObject,’Max’) to determine range of slider
global nadhThreshold;
global maskShowImage;
global nadhTextImage
nadhThreshold = get(handles.slider3 ,’Value’);
% get the image mask
maskShowImage = nadhTextImage;
maskShowImage(maskShowImage < nadhThreshold) = 0;
set(handles.edit1 , ‘String’, num2str(nadhThreshold));
axes(handles.axes4);
imagesc(maskShowImage)
colormap(gray)
colorbar
% — Executes during object creation, after setting all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,[.9 .9 .9]);
end
function slider3_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles empty – handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’))
set(hObject,’BackgroundColor’,[.9 .9 .9]);
end
% — Executes on button press in pushbutton17.
function pushbutton17_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton17 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global nadhFileName;
global nadhPathName;
global nadhT1Image;
% Get the location of the image
nadhT1FileName = strrep(nadhFileName,’photons’,’t1′);
nadhT1PathName = nadhPathName;
nadhT1Image = importdata(strcat(nadhT1PathName,nadhT1FileName));
nadhT1Image(nadhT1Image > 8000) = 0;
nadhT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes7);
imagesc(nadhT1Image)
colormap(gray)
colorbar
set(handles.text7 , ‘String’, nadhT1FileName);
global nadhT2Image;
% Get the location of the image
nadhT2FileName = strrep(nadhFileName,’photons’,’t2′);
nadhT2PathName = nadhPathName;
nadhT2Image = importdata(strcat(nadhT2PathName,nadhT2FileName));
nadhT2Image(nadhT2Image > 8000) = 0;
nadhT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes8);
imagesc(nadhT2Image)
colormap(gray)
colorbar
set(handles.text8 , ‘String’, nadhT2FileName);
global nadhAlphaImage;
% Get the location of the image
nadhAlphaFileName = strrep(nadhFileName,’photons’,’a1[%]’);
nadhAlphaPathName = nadhPathName;
nadhAlphaImage = importdata(strcat(nadhAlphaPathName,nadhAlphaFileName));
nadhAlphaImage(nadhAlphaImage>100) = 0;
nadhAlphaImage(nadhAlphaImage<0) = 0;
nadhAlphaImage(:,245:256) = 0;
% display the NADH image in axes7 and show the image name
axes(handles.axes9);
imagesc(nadhAlphaImage)
colormap(gray)
colorbar
set(handles.text9 , ‘String’, nadhAlphaFileName);
global fadFileName;
global fadPathName;
global fadT1Image;
% Get the location of the image
fadT1FileName = strrep(fadFileName,’photons’,’t1′);
fadT1PathName = fadPathName;
fadT1Image = importdata(strcat(fadT1PathName,fadT1FileName));
fadT1Image(fadT1Image > 8000) = 0;
fadT1Image(fadT1Image < 0) = 0;
fadT1Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes10);
imagesc(fadT1Image)
colormap(gray)
colorbar
set(handles.text10 , ‘String’, fadT1FileName);
global fadT2Image;
% Get the location of the image
fadT2FileName = strrep(fadFileName,’photons’,’t2′);
fadT2PathName = fadPathName;
fadT2Image = importdata(strcat(fadT2PathName,fadT2FileName));
fadT2Image(fadT2Image>8000) = 0;
fadT2Image(fadT2Image < 0) = 0;
fadT2Image(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes11);
imagesc(fadT2Image)
colormap(gray)
colorbar
set(handles.text11 , ‘String’, fadT2FileName)
global fadAlphaImage;
% Get the location of the image
fadAplhaFileName = strrep(fadFileName,’photons’,’a1[%]’);
fadAlphaPathName = fadPathName;
fadAlphaImage = importdata(strcat(fadAlphaPathName,fadAplhaFileName));
fadAlphaImage(fadAlphaImage>100) = 0;
fadAlphaImage(fadAlphaImage<0) = 0;
fadAlphaImage(:,245:256)=0;
% display the NADH image in axes7 and show the image name
axes(handles.axes12);
imagesc(fadAlphaImage)
colormap(gray)
colorbar
set(handles.text12 , ‘String’, fadAplhaFileName); hobject, eventdata, handles MATLAB Answers — New Questions