Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
HRV_MEG
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ryan Christopher Godwin
HRV_MEG
Commits
313aedbd
Commit
313aedbd
authored
2 years ago
by
Ryan Godwin
Browse files
Options
Downloads
Patches
Plain Diff
Minor updates to main and meg to ica
parent
48361590
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Progress toward getting the evaluation integrated
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/hrvmeg/main.py
+6
-22
6 additions, 22 deletions
src/hrvmeg/main.py
src/utils/meg_to_ica.py
+0
-6
0 additions, 6 deletions
src/utils/meg_to_ica.py
with
6 additions
and
28 deletions
src/hrvmeg/main.py
+
6
−
22
View file @
313aedbd
...
...
@@ -61,8 +61,9 @@ def extract_ica_from_meg(
)
MNE_proc
.
process
()
fig
,
ax
=
MNE_proc
.
plot
()
#TODO add plotting here
# fig, ax = MNE_proc.plot()
logger
.
info
(
"
✅ ICA successfully calculated on MEG data with MNE
"
)
with
mlflow
.
start_run
(
run_name
=
run_name
)
as
run
:
...
...
@@ -71,30 +72,13 @@ def extract_ica_from_meg(
mlflow
.
log_params
(
args
)
mlflow
.
log_artifact
(
full_csv_output_path
)
# ###############################################################################
# # filter dataframe to only heartifact and Time index
# indices_to_filter = [0, heartifact + 1]
# df = pd.read_csv(full_csv_output_path)
# df = df.iloc[:, indices_to_filter]
# df.to_csv(full_csv_output_path, index=False)
# ###############################################################################
# # feed .mat filepath and heartifact list to Get_RR_Intervals.py to get RR intervals for each heartifact
# getRR = data.GetRRComponent(output_sub_dir, scan_file, full_csv_output_path, heartifact)
# # getRR = Get_RR_Intervals.GetRRIntervals(scan_file, heartifacts)
# getRR.get_RR_intervals()
# Save to config
# Save to config folder
open
(
Path
(
config
.
CONFIG_DIR
,
"
run_id.txt
"
),
"
w
"
,
encoding
=
"
utf-8
"
).
write
(
run_id
)
if
counter
<
len
(
scan_files
):
counter
=
counter
+
1
print
(
"
counter -
"
,
counter
)
else
:
output_filepath
=
Path
(
config
.
CONFIG
_DIR
,
"
output_ic.txt
"
)
output_filepath
=
Path
(
config
.
INTERMEDIATE
_DIR
,
"
output_ic
a_files
.txt
"
)
with
open
(
output_filepath
,
"
w
"
,
encoding
=
"
utf-8
"
)
as
f
:
for
item
in
output_files
:
str_item
=
str
(
item
)
...
...
@@ -118,7 +102,7 @@ def label_cardiac_ic(
run_name (str): str =
"
sgd
"
,. Defaults to sgd
test_run (bool): bool = False,. Defaults to False
"""
input_filepaths
=
open
(
Path
(
config
.
CONFIG
_DIR
,
"
output_ic.txt
"
),
"
r
"
)
input_filepaths
=
open
(
Path
(
config
.
INTERMEDIATE
_DIR
,
"
output_ic
a_files
.txt
"
),
"
r
"
)
input_list
=
input_filepaths
.
read
()
input_list
for
file
in
input_list
.
split
(
"
,
"
):
...
...
This diff is collapsed.
Click to expand it.
src/utils/meg_to_ica.py
+
0
−
6
View file @
313aedbd
...
...
@@ -114,10 +114,4 @@ class MNE_Processor:
self
.
_ica_
=
np
.
array
(
sigi
).
T
return
{
"
args
"
:
self
.
args
}
def
plot
(
self
):
N
=
len
(
self
.
_time_
.
shape
[
1
])
fig
,
ax
=
plt
.
subplots
(
len
(
self
.
_time_
.
shape
[
1
]),
1
,
figsize
=
(
7
,
5
))
for
idx
in
range
(
len
(
N
)):
ax
[
idx
].
plot
(
self
.
_time_
,
self
.
_ica_
[
idx
])
return
fig
,
ax
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment