Skip to content

Commit

Permalink
Edge detection is now used to improve object position detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
martin3141 committed Jan 10, 2019
1 parent e05d278 commit 22cddc5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
@@ -1,8 +1,8 @@
Package: fmriqa
Type: Package
Title: Functional MRI Quality Assurance Routines
Version: 0.3.0
Date: 2018-02-19
Version: 0.4.0
Date: 2019-01-10
Authors@R: person("Martin", "Wilson", email = "martin@pipegrep.co.uk",
role = c("cre","aut"))
Description: Methods for performing fMRI quality assurance (QA) measurements of
Expand All @@ -11,7 +11,7 @@ Description: Methods for performing fMRI quality assurance (QA) measurements of
BugReports: https://github.com/martin3141/fmriqa/issues
License: GPL-3
LazyData: true
RoxygenNote: 6.0.1
RoxygenNote: 6.1.1
Imports:
viridisLite,
RNifti,
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
@@ -1,3 +1,6 @@
# fmriqa 0.4.0
* Edge detection is now used to improve object position detection.

# fmriqa 0.3.0
* Improved method for calculating the object center of gravity for automated
ROI placement.
Expand Down
5 changes: 3 additions & 2 deletions R/run_fmriqa.R
Expand Up @@ -178,9 +178,10 @@ run_fmriqa <- function(data_file = NULL, roi_width = 21, slice_num = NULL,
# set na values to zero
SFNR_full[is.na(SFNR_full)] <- 0

# threshold the image to reduce inhomogenity for cog calc
# threshold the image using edge detection to reduce inhomogenity for cog calc
av_image_cimg <- imager::as.cimg(av_image)
obj_thr <- imager::threshold(av_image_cimg)
obj_thr <- imager::px.flood(imager::as.cimg(imager::cannyEdges(av_image_cimg)), x_dim / 2, y_dim / 2)

cog_image <- obj_thr[,]

# mean object intensity
Expand Down
13 changes: 7 additions & 6 deletions man/run_fmriqa.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified tests/testthat/ref_results.rds
Binary file not shown.

0 comments on commit 22cddc5

Please sign in to comment.