SlideShare una empresa de Scribd logo
1 de 16
Descargar para leer sin conexión
Jon Clayden <j.clayden@ucl.ac.uk>
Photo by José Martín Ramírez Carrasco
https://www.behance.net/martini_rc
Image processing and alignment with
RNiftyReg and mmand
useR! 2015, Aalborg, Denmark
Images
• Produced and analysed across a
wide range of disciplines
• Single-channel or multichannel
(e.g., RGB)
• Fundamentally numeric arrays of
two (or more) dimensions
• Often processed to identify or
emphasise features of interest
• Good fit to R’s vector-based
paradigm
ESA/Rosetta/NAVCAM
Mathematical morphology
• Basis of morphological image
processing
• Erosion/dilation: region growing/
shrinking
• Opening/closing: e.g., removing
“holes”
• Additional composite processes
• A kernel, or “structuring element”,
acts like a brush
• The mmand package can work in
any number of dimensions, with
arbitrary kernels
• Bioconductor package EBImage
also offers (2D) morphology
Wikipedia/Renato Keshet
Binary morphology in 1D
library(mmand)
x <- c(0,0,1,0,0,0,1,1,1,0,0)
kernel <- c(1,1,1)
erode(x,kernel)
dilate(x,kernel)
Two dimensions
library(png)
fan <- readPNG(system.file("images", "fan.png", package="mmand"))
display(fan)
Greyscale morphology in 2D
kernel <- shapeKernel(c(3,3), type="diamond")
display(erode(fan,kernel))
Morphological gradient
kernel <- shapeKernel(c(3,3), type="diamond")
display(dilate(fan,kernel) - erode(fan,kernel))
Resampling
• Indexing between elements
• R truncates 2.5 to 2 and returns the
second element
• In some cases there is conceptually
a value at location 2.5 but we don’t
know it
• Best guess is probably that it’s 0,
or 1, something in between
• Using mmand we can interpolate
using different sampling kernels
• An entire image of any
dimensionality can be resampled
similarly
• Allows regridding, upsampling and
downsampling
x <- c(0,0,1,0,0)
x[2.5]
# [1] 0
# "Nearest neighbour"
resample(x, 2.5, boxKernel())
# [1] 1
# Linear interpolation
resample(x, 2.5, triangleKernel())
# [1] 0.5
# Mitchell-Netravali cubic spline
resample(x, 2.5,
mitchellNetravaliKernel(1/3,1/3))
# [1] 0.5347222
Upsampling a quarter-size image
fan_small <- readPNG(system.file("images", "fan-small.png", package="mmand"))
display(rescale(fan_small, 4, mnKernel()))
Image registration
• Aligning two related images
• Contrasts may be similar or
different
• Pixel information may be combined
• Optimisation over a space of
transformations (global/linear or
local/nonlinear)
• Resampling to match the target
image
Jiří Borovec, Czech Technical University, Prague
RNiftyReg scope
• R wrapper for NiftyReg (C++)
• Affine (linear) and nonlinear
registration
• 2D or 3D (target may also be 4D)
• Control over cost function,
resampling scheme
• Can apply transformations to
other images or points
• Substantial update (to v2.0.0)
currently in progress; hopefully
coming in July
RNiftyReg usage (3D)
library(oro.nifti)
library(RNiftyReg)
source <- readNIfTI(system.file("extdata","source.nii.gz",package="RNiftyReg"))
target <- readNIfTI(system.file("extdata","target.nii.gz",package="RNiftyReg"))
linear <- niftyreg(source, target, scope="affine")
nonlinear <- niftyreg(source, target, scope="nonlinear", init=linear$affine)
source target result (nonlinear)
Combining the packages: checking registration
library(jpeg)
library(mmand)
library(RNiftyReg)
# Read images and convert to greyscale
source <- readJPEG("source.jpg")
target <- readJPEG("target.jpg")
source <- apply(source, 1:2, mean)
target <- apply(target, 1:2, mean)
# Register images
result <- niftyreg(source, target)
# Calculate morphological gradient
kernel <- shapeKernel(c(3,3), type="diamond")
gradient <- dilate(result$image,kernel) - erode(result$image,kernel)
# Display the results
display(target)
display(threshold(gradient,method="kmeans"), add=TRUE, col="red")
Combining the packages: checking registration
Some related packages
• Medical Imaging CRAN task view
• TractoR, a broader R-based
platform for medical image
analysis
• EBImage (BioC)
• adimpro, ripa, etc. (CRAN)
• imager (GitHub)
Contact details
• Email: j.clayden@ucl.ac.uk or
code@clayden.org
• Twitter: @jonclayden
• GitHub: https://github.com/
jonclayden
• TractoR: http://www.tractor-
mri.org.uk

Más contenido relacionado

La actualidad más candente

20150703.journal club
20150703.journal club20150703.journal club
20150703.journal clubHayaru SHOUNO
 
HRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
HRNET : Deep High-Resolution Representation Learning for Human Pose EstimationHRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
HRNET : Deep High-Resolution Representation Learning for Human Pose Estimationtaeseon ryu
 
PR-344: A Battle of Network Structures: An Empirical Study of CNN, Transforme...
PR-344: A Battle of Network Structures: An Empirical Study of CNN, Transforme...PR-344: A Battle of Network Structures: An Empirical Study of CNN, Transforme...
PR-344: A Battle of Network Structures: An Empirical Study of CNN, Transforme...Jinwon Lee
 
[Icml2019] parameter efficient training of deep convolutional neural network...
[Icml2019] parameter efficient training of  deep convolutional neural network...[Icml2019] parameter efficient training of  deep convolutional neural network...
[Icml2019] parameter efficient training of deep convolutional neural network...LeapMind Inc
 
Multimodal Residual Learning for Visual QA
Multimodal Residual Learning for Visual QAMultimodal Residual Learning for Visual QA
Multimodal Residual Learning for Visual QANamHyuk Ahn
 
IRJET- Crowd Density Estimation using Novel Feature Descriptor
IRJET- Crowd Density Estimation using Novel Feature DescriptorIRJET- Crowd Density Estimation using Novel Feature Descriptor
IRJET- Crowd Density Estimation using Novel Feature DescriptorIRJET Journal
 
20140530.journal club
20140530.journal club20140530.journal club
20140530.journal clubHayaru SHOUNO
 
DNR - Auto deep lab paper review ppt
DNR - Auto deep lab paper review pptDNR - Auto deep lab paper review ppt
DNR - Auto deep lab paper review ppttaeseon ryu
 
PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...
PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...
PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...VLSICS Design
 
Image Reconstruction MATLAB Projects Research Guidance
Image Reconstruction MATLAB Projects Research GuidanceImage Reconstruction MATLAB Projects Research Guidance
Image Reconstruction MATLAB Projects Research GuidanceMatlab Simulation
 
[Icml2019] mix hop higher-order graph convolutional architectures via spars...
[Icml2019]  mix hop  higher-order graph convolutional architectures via spars...[Icml2019]  mix hop  higher-order graph convolutional architectures via spars...
[Icml2019] mix hop higher-order graph convolutional architectures via spars...LeapMind Inc
 
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEM
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEMGRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEM
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEMIJCSEA Journal
 
Image Processing IEEE 2015 Projects
Image Processing IEEE 2015 ProjectsImage Processing IEEE 2015 Projects
Image Processing IEEE 2015 ProjectsVijay Karan
 
PR-317: MLP-Mixer: An all-MLP Architecture for Vision
PR-317: MLP-Mixer: An all-MLP Architecture for VisionPR-317: MLP-Mixer: An all-MLP Architecture for Vision
PR-317: MLP-Mixer: An all-MLP Architecture for VisionJinwon Lee
 
Object Detection Beyond Mask R-CNN and RetinaNet III
Object Detection Beyond Mask R-CNN and RetinaNet IIIObject Detection Beyond Mask R-CNN and RetinaNet III
Object Detection Beyond Mask R-CNN and RetinaNet IIIWanjin Yu
 
FAST AND EFFICIENT IMAGE COMPRESSION BASED ON PARALLEL COMPUTING USING MATLAB
FAST AND EFFICIENT IMAGE COMPRESSION BASED ON PARALLEL COMPUTING USING MATLABFAST AND EFFICIENT IMAGE COMPRESSION BASED ON PARALLEL COMPUTING USING MATLAB
FAST AND EFFICIENT IMAGE COMPRESSION BASED ON PARALLEL COMPUTING USING MATLABJournal For Research
 
A completed modeling of local binary pattern operator
A completed modeling of local binary pattern operatorA completed modeling of local binary pattern operator
A completed modeling of local binary pattern operatorWin Yu
 
Memetic MO Ant Colony Algorithm for TSALBP
Memetic MO Ant Colony Algorithm for TSALBPMemetic MO Ant Colony Algorithm for TSALBP
Memetic MO Ant Colony Algorithm for TSALBPManuel ChiSe
 
Image Processing IEEE 2015 Projects
Image Processing IEEE 2015 ProjectsImage Processing IEEE 2015 Projects
Image Processing IEEE 2015 ProjectsVijay Karan
 

La actualidad más candente (20)

Aerial detection1
Aerial detection1Aerial detection1
Aerial detection1
 
20150703.journal club
20150703.journal club20150703.journal club
20150703.journal club
 
HRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
HRNET : Deep High-Resolution Representation Learning for Human Pose EstimationHRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
HRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
 
PR-344: A Battle of Network Structures: An Empirical Study of CNN, Transforme...
PR-344: A Battle of Network Structures: An Empirical Study of CNN, Transforme...PR-344: A Battle of Network Structures: An Empirical Study of CNN, Transforme...
PR-344: A Battle of Network Structures: An Empirical Study of CNN, Transforme...
 
[Icml2019] parameter efficient training of deep convolutional neural network...
[Icml2019] parameter efficient training of  deep convolutional neural network...[Icml2019] parameter efficient training of  deep convolutional neural network...
[Icml2019] parameter efficient training of deep convolutional neural network...
 
Multimodal Residual Learning for Visual QA
Multimodal Residual Learning for Visual QAMultimodal Residual Learning for Visual QA
Multimodal Residual Learning for Visual QA
 
IRJET- Crowd Density Estimation using Novel Feature Descriptor
IRJET- Crowd Density Estimation using Novel Feature DescriptorIRJET- Crowd Density Estimation using Novel Feature Descriptor
IRJET- Crowd Density Estimation using Novel Feature Descriptor
 
20140530.journal club
20140530.journal club20140530.journal club
20140530.journal club
 
DNR - Auto deep lab paper review ppt
DNR - Auto deep lab paper review pptDNR - Auto deep lab paper review ppt
DNR - Auto deep lab paper review ppt
 
PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...
PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...
PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...
 
Image Reconstruction MATLAB Projects Research Guidance
Image Reconstruction MATLAB Projects Research GuidanceImage Reconstruction MATLAB Projects Research Guidance
Image Reconstruction MATLAB Projects Research Guidance
 
[Icml2019] mix hop higher-order graph convolutional architectures via spars...
[Icml2019]  mix hop  higher-order graph convolutional architectures via spars...[Icml2019]  mix hop  higher-order graph convolutional architectures via spars...
[Icml2019] mix hop higher-order graph convolutional architectures via spars...
 
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEM
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEMGRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEM
GRAPH MATCHING ALGORITHM FOR TASK ASSIGNMENT PROBLEM
 
Image Processing IEEE 2015 Projects
Image Processing IEEE 2015 ProjectsImage Processing IEEE 2015 Projects
Image Processing IEEE 2015 Projects
 
PR-317: MLP-Mixer: An all-MLP Architecture for Vision
PR-317: MLP-Mixer: An all-MLP Architecture for VisionPR-317: MLP-Mixer: An all-MLP Architecture for Vision
PR-317: MLP-Mixer: An all-MLP Architecture for Vision
 
Object Detection Beyond Mask R-CNN and RetinaNet III
Object Detection Beyond Mask R-CNN and RetinaNet IIIObject Detection Beyond Mask R-CNN and RetinaNet III
Object Detection Beyond Mask R-CNN and RetinaNet III
 
FAST AND EFFICIENT IMAGE COMPRESSION BASED ON PARALLEL COMPUTING USING MATLAB
FAST AND EFFICIENT IMAGE COMPRESSION BASED ON PARALLEL COMPUTING USING MATLABFAST AND EFFICIENT IMAGE COMPRESSION BASED ON PARALLEL COMPUTING USING MATLAB
FAST AND EFFICIENT IMAGE COMPRESSION BASED ON PARALLEL COMPUTING USING MATLAB
 
A completed modeling of local binary pattern operator
A completed modeling of local binary pattern operatorA completed modeling of local binary pattern operator
A completed modeling of local binary pattern operator
 
Memetic MO Ant Colony Algorithm for TSALBP
Memetic MO Ant Colony Algorithm for TSALBPMemetic MO Ant Colony Algorithm for TSALBP
Memetic MO Ant Colony Algorithm for TSALBP
 
Image Processing IEEE 2015 Projects
Image Processing IEEE 2015 ProjectsImage Processing IEEE 2015 Projects
Image Processing IEEE 2015 Projects
 

Destacado

1 fashion social media campaigns alzbeta-m_fashiontech
1 fashion social media campaigns alzbeta-m_fashiontech1 fashion social media campaigns alzbeta-m_fashiontech
1 fashion social media campaigns alzbeta-m_fashiontechfashiontechcz
 
PCF_Soln_Brief-New
PCF_Soln_Brief-NewPCF_Soln_Brief-New
PCF_Soln_Brief-Newkarunbakshi
 
Ggge2123 esei
Ggge2123 eseiGgge2123 esei
Ggge2123 eseiamyza79
 
Httpool fashion week2015
Httpool fashion week2015Httpool fashion week2015
Httpool fashion week2015fashiontechcz
 
Eshopping bazar company catalogue
Eshopping bazar company catalogueEshopping bazar company catalogue
Eshopping bazar company catalogueeShopping Bazar
 
Why Asia is the Emerging as the World's EdTech Laboratory
Why Asia is the Emerging as the World's EdTech LaboratoryWhy Asia is the Emerging as the World's EdTech Laboratory
Why Asia is the Emerging as the World's EdTech LaboratoryTodd Maurer
 
งานคอมพิวเตอร์
งานคอมพิวเตอร์งานคอมพิวเตอร์
งานคอมพิวเตอร์Mark'k Stk
 
ΚΙΤΟU ANNA CV-EN
ΚΙΤΟU ANNA CV-ENΚΙΤΟU ANNA CV-EN
ΚΙΤΟU ANNA CV-ENANNA KITOU
 
ใบงานที่4 53-13
ใบงานที่4 53-13ใบงานที่4 53-13
ใบงานที่4 53-13Mark'k Stk
 
Top Management Techniques
Top Management TechniquesTop Management Techniques
Top Management TechniquesIrv Holmes
 
3 size id-fashiontechcz
3 size id-fashiontechcz3 size id-fashiontechcz
3 size id-fashiontechczfashiontechcz
 
Safeguarding in Maternity Services
Safeguarding  in Maternity ServicesSafeguarding  in Maternity Services
Safeguarding in Maternity ServicesLGTNHS
 
Smart Simple Global
Smart Simple GlobalSmart Simple Global
Smart Simple Globalprofitbomber
 
Pramod Kumar Behera
Pramod Kumar BeheraPramod Kumar Behera
Pramod Kumar BeheraPramod Kumar
 
Instructional Design and Development
Instructional Design and DevelopmentInstructional Design and Development
Instructional Design and DevelopmentKlm102
 

Destacado (20)

Qiy4link
Qiy4link Qiy4link
Qiy4link
 
1 fashion social media campaigns alzbeta-m_fashiontech
1 fashion social media campaigns alzbeta-m_fashiontech1 fashion social media campaigns alzbeta-m_fashiontech
1 fashion social media campaigns alzbeta-m_fashiontech
 
PCF_Soln_Brief-New
PCF_Soln_Brief-NewPCF_Soln_Brief-New
PCF_Soln_Brief-New
 
Ggge2123 esei
Ggge2123 eseiGgge2123 esei
Ggge2123 esei
 
Training Certificates
Training CertificatesTraining Certificates
Training Certificates
 
Httpool fashion week2015
Httpool fashion week2015Httpool fashion week2015
Httpool fashion week2015
 
Avrora boat
Avrora boatAvrora boat
Avrora boat
 
Eshopping bazar company catalogue
Eshopping bazar company catalogueEshopping bazar company catalogue
Eshopping bazar company catalogue
 
Why Asia is the Emerging as the World's EdTech Laboratory
Why Asia is the Emerging as the World's EdTech LaboratoryWhy Asia is the Emerging as the World's EdTech Laboratory
Why Asia is the Emerging as the World's EdTech Laboratory
 
Colmos
Colmos Colmos
Colmos
 
งานคอมพิวเตอร์
งานคอมพิวเตอร์งานคอมพิวเตอร์
งานคอมพิวเตอร์
 
ΚΙΤΟU ANNA CV-EN
ΚΙΤΟU ANNA CV-ENΚΙΤΟU ANNA CV-EN
ΚΙΤΟU ANNA CV-EN
 
ใบงานที่4 53-13
ใบงานที่4 53-13ใบงานที่4 53-13
ใบงานที่4 53-13
 
Top Management Techniques
Top Management TechniquesTop Management Techniques
Top Management Techniques
 
Mani Resume
Mani ResumeMani Resume
Mani Resume
 
3 size id-fashiontechcz
3 size id-fashiontechcz3 size id-fashiontechcz
3 size id-fashiontechcz
 
Safeguarding in Maternity Services
Safeguarding  in Maternity ServicesSafeguarding  in Maternity Services
Safeguarding in Maternity Services
 
Smart Simple Global
Smart Simple GlobalSmart Simple Global
Smart Simple Global
 
Pramod Kumar Behera
Pramod Kumar BeheraPramod Kumar Behera
Pramod Kumar Behera
 
Instructional Design and Development
Instructional Design and DevelopmentInstructional Design and Development
Instructional Design and Development
 

Similar a Image processing and alignment with RNiftyReg and mmand

Review : Multi-Domain Image Completion for Random Missing Input Data [cdm]
Review : Multi-Domain Image Completion for Random Missing Input Data [cdm]Review : Multi-Domain Image Completion for Random Missing Input Data [cdm]
Review : Multi-Domain Image Completion for Random Missing Input Data [cdm]Dongmin Choi
 
Image Segmentation Using Deep Learning : A survey
Image Segmentation Using Deep Learning : A surveyImage Segmentation Using Deep Learning : A survey
Image Segmentation Using Deep Learning : A surveyNUPUR YADAV
 
Presentation vision transformersppt.pptx
Presentation vision transformersppt.pptxPresentation vision transformersppt.pptx
Presentation vision transformersppt.pptxhtn540
 
Ice: lightweight, efficient rendering for remote sensing images
Ice: lightweight, efficient rendering for remote sensing imagesIce: lightweight, efficient rendering for remote sensing images
Ice: lightweight, efficient rendering for remote sensing imagesotb
 
Using A Application For A Desktop Application
Using A Application For A Desktop ApplicationUsing A Application For A Desktop Application
Using A Application For A Desktop ApplicationTracy Huang
 
Cahall Final Intern Presentation
Cahall Final Intern PresentationCahall Final Intern Presentation
Cahall Final Intern PresentationDaniel Cahall
 
Intro_OpenCV.ppt
Intro_OpenCV.pptIntro_OpenCV.ppt
Intro_OpenCV.pptRithikRaj25
 
IEEE 2015 Matlab Projects
IEEE 2015 Matlab ProjectsIEEE 2015 Matlab Projects
IEEE 2015 Matlab ProjectsVijay Karan
 
IMAGE SEGMENTATION BY MODIFIED MAP-ML ESTIMATIONS
IMAGE SEGMENTATION BY MODIFIED MAP-ML ESTIMATIONSIMAGE SEGMENTATION BY MODIFIED MAP-ML ESTIMATIONS
IMAGE SEGMENTATION BY MODIFIED MAP-ML ESTIMATIONScscpconf
 
Image segmentation by modified map ml
Image segmentation by modified map mlImage segmentation by modified map ml
Image segmentation by modified map mlcsandit
 
Image segmentation by modified map ml estimations
Image segmentation by modified map ml estimationsImage segmentation by modified map ml estimations
Image segmentation by modified map ml estimationsijesajournal
 
IEEE 2015 Matlab Projects
IEEE 2015 Matlab ProjectsIEEE 2015 Matlab Projects
IEEE 2015 Matlab ProjectsVijay Karan
 
Why Image compression is Necessary?
Why Image compression is Necessary?Why Image compression is Necessary?
Why Image compression is Necessary?Prabhat Kumar
 
Corrosion Detection Using A.I : A Comparison of Standard Computer Vision Tech...
Corrosion Detection Using A.I : A Comparison of Standard Computer Vision Tech...Corrosion Detection Using A.I : A Comparison of Standard Computer Vision Tech...
Corrosion Detection Using A.I : A Comparison of Standard Computer Vision Tech...csandit
 

Similar a Image processing and alignment with RNiftyReg and mmand (20)

Review : Multi-Domain Image Completion for Random Missing Input Data [cdm]
Review : Multi-Domain Image Completion for Random Missing Input Data [cdm]Review : Multi-Domain Image Completion for Random Missing Input Data [cdm]
Review : Multi-Domain Image Completion for Random Missing Input Data [cdm]
 
Image Segmentation Using Deep Learning : A survey
Image Segmentation Using Deep Learning : A surveyImage Segmentation Using Deep Learning : A survey
Image Segmentation Using Deep Learning : A survey
 
Presentation vision transformersppt.pptx
Presentation vision transformersppt.pptxPresentation vision transformersppt.pptx
Presentation vision transformersppt.pptx
 
Ice: lightweight, efficient rendering for remote sensing images
Ice: lightweight, efficient rendering for remote sensing imagesIce: lightweight, efficient rendering for remote sensing images
Ice: lightweight, efficient rendering for remote sensing images
 
Using A Application For A Desktop Application
Using A Application For A Desktop ApplicationUsing A Application For A Desktop Application
Using A Application For A Desktop Application
 
Cahall Final Intern Presentation
Cahall Final Intern PresentationCahall Final Intern Presentation
Cahall Final Intern Presentation
 
Introduction to OpenCV
Introduction to OpenCVIntroduction to OpenCV
Introduction to OpenCV
 
MATLAB & Image Processing
MATLAB & Image ProcessingMATLAB & Image Processing
MATLAB & Image Processing
 
Log polar coordinates
Log polar coordinatesLog polar coordinates
Log polar coordinates
 
Intro_OpenCV.ppt
Intro_OpenCV.pptIntro_OpenCV.ppt
Intro_OpenCV.ppt
 
IEEE 2015 Matlab Projects
IEEE 2015 Matlab ProjectsIEEE 2015 Matlab Projects
IEEE 2015 Matlab Projects
 
IMAGE SEGMENTATION BY MODIFIED MAP-ML ESTIMATIONS
IMAGE SEGMENTATION BY MODIFIED MAP-ML ESTIMATIONSIMAGE SEGMENTATION BY MODIFIED MAP-ML ESTIMATIONS
IMAGE SEGMENTATION BY MODIFIED MAP-ML ESTIMATIONS
 
Image segmentation by modified map ml
Image segmentation by modified map mlImage segmentation by modified map ml
Image segmentation by modified map ml
 
Image segmentation by modified map ml estimations
Image segmentation by modified map ml estimationsImage segmentation by modified map ml estimations
Image segmentation by modified map ml estimations
 
IPT.pdf
IPT.pdfIPT.pdf
IPT.pdf
 
Yarn spark next_gen_hadoop_8_jan_2014
Yarn spark next_gen_hadoop_8_jan_2014Yarn spark next_gen_hadoop_8_jan_2014
Yarn spark next_gen_hadoop_8_jan_2014
 
R user group meeting 25th jan 2017
R user group meeting 25th jan 2017R user group meeting 25th jan 2017
R user group meeting 25th jan 2017
 
IEEE 2015 Matlab Projects
IEEE 2015 Matlab ProjectsIEEE 2015 Matlab Projects
IEEE 2015 Matlab Projects
 
Why Image compression is Necessary?
Why Image compression is Necessary?Why Image compression is Necessary?
Why Image compression is Necessary?
 
Corrosion Detection Using A.I : A Comparison of Standard Computer Vision Tech...
Corrosion Detection Using A.I : A Comparison of Standard Computer Vision Tech...Corrosion Detection Using A.I : A Comparison of Standard Computer Vision Tech...
Corrosion Detection Using A.I : A Comparison of Standard Computer Vision Tech...
 

Último

VIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PVIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PPRINCE C P
 
Zoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdfZoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdfSumit Kumar yadav
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPirithiRaju
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...RohitNehra6
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Sérgio Sacani
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bSérgio Sacani
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfrohankumarsinghrore1
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​kaibalyasahoo82800
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...anilsa9823
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxgindu3009
 
Biological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfBiological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfmuntazimhurra
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )aarthirajkumar25
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTSérgio Sacani
 
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencyHire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencySheetal Arora
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)Areesha Ahmad
 
Natural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsNatural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsAArockiyaNisha
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoSérgio Sacani
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bSérgio Sacani
 

Último (20)

VIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PVIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C P
 
Zoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdfZoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdf
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
The Philosophy of Science
The Philosophy of ScienceThe Philosophy of Science
The Philosophy of Science
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdf
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
 
Biological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfBiological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdf
 
CELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdfCELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdf
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOST
 
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencyHire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)
 
Natural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsNatural Polymer Based Nanomaterials
Natural Polymer Based Nanomaterials
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on Io
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
 

Image processing and alignment with RNiftyReg and mmand

  • 1. Jon Clayden <j.clayden@ucl.ac.uk> Photo by José Martín Ramírez Carrasco https://www.behance.net/martini_rc Image processing and alignment with RNiftyReg and mmand useR! 2015, Aalborg, Denmark
  • 2. Images • Produced and analysed across a wide range of disciplines • Single-channel or multichannel (e.g., RGB) • Fundamentally numeric arrays of two (or more) dimensions • Often processed to identify or emphasise features of interest • Good fit to R’s vector-based paradigm ESA/Rosetta/NAVCAM
  • 3. Mathematical morphology • Basis of morphological image processing • Erosion/dilation: region growing/ shrinking • Opening/closing: e.g., removing “holes” • Additional composite processes • A kernel, or “structuring element”, acts like a brush • The mmand package can work in any number of dimensions, with arbitrary kernels • Bioconductor package EBImage also offers (2D) morphology Wikipedia/Renato Keshet
  • 4. Binary morphology in 1D library(mmand) x <- c(0,0,1,0,0,0,1,1,1,0,0) kernel <- c(1,1,1) erode(x,kernel) dilate(x,kernel)
  • 5. Two dimensions library(png) fan <- readPNG(system.file("images", "fan.png", package="mmand")) display(fan)
  • 6. Greyscale morphology in 2D kernel <- shapeKernel(c(3,3), type="diamond") display(erode(fan,kernel))
  • 7. Morphological gradient kernel <- shapeKernel(c(3,3), type="diamond") display(dilate(fan,kernel) - erode(fan,kernel))
  • 8. Resampling • Indexing between elements • R truncates 2.5 to 2 and returns the second element • In some cases there is conceptually a value at location 2.5 but we don’t know it • Best guess is probably that it’s 0, or 1, something in between • Using mmand we can interpolate using different sampling kernels • An entire image of any dimensionality can be resampled similarly • Allows regridding, upsampling and downsampling x <- c(0,0,1,0,0) x[2.5] # [1] 0 # "Nearest neighbour" resample(x, 2.5, boxKernel()) # [1] 1 # Linear interpolation resample(x, 2.5, triangleKernel()) # [1] 0.5 # Mitchell-Netravali cubic spline resample(x, 2.5, mitchellNetravaliKernel(1/3,1/3)) # [1] 0.5347222
  • 9. Upsampling a quarter-size image fan_small <- readPNG(system.file("images", "fan-small.png", package="mmand")) display(rescale(fan_small, 4, mnKernel()))
  • 10. Image registration • Aligning two related images • Contrasts may be similar or different • Pixel information may be combined • Optimisation over a space of transformations (global/linear or local/nonlinear) • Resampling to match the target image Jiří Borovec, Czech Technical University, Prague
  • 11. RNiftyReg scope • R wrapper for NiftyReg (C++) • Affine (linear) and nonlinear registration • 2D or 3D (target may also be 4D) • Control over cost function, resampling scheme • Can apply transformations to other images or points • Substantial update (to v2.0.0) currently in progress; hopefully coming in July
  • 12. RNiftyReg usage (3D) library(oro.nifti) library(RNiftyReg) source <- readNIfTI(system.file("extdata","source.nii.gz",package="RNiftyReg")) target <- readNIfTI(system.file("extdata","target.nii.gz",package="RNiftyReg")) linear <- niftyreg(source, target, scope="affine") nonlinear <- niftyreg(source, target, scope="nonlinear", init=linear$affine) source target result (nonlinear)
  • 13. Combining the packages: checking registration library(jpeg) library(mmand) library(RNiftyReg) # Read images and convert to greyscale source <- readJPEG("source.jpg") target <- readJPEG("target.jpg") source <- apply(source, 1:2, mean) target <- apply(target, 1:2, mean) # Register images result <- niftyreg(source, target) # Calculate morphological gradient kernel <- shapeKernel(c(3,3), type="diamond") gradient <- dilate(result$image,kernel) - erode(result$image,kernel) # Display the results display(target) display(threshold(gradient,method="kmeans"), add=TRUE, col="red")
  • 14. Combining the packages: checking registration
  • 15. Some related packages • Medical Imaging CRAN task view • TractoR, a broader R-based platform for medical image analysis • EBImage (BioC) • adimpro, ripa, etc. (CRAN) • imager (GitHub)
  • 16. Contact details • Email: j.clayden@ucl.ac.uk or code@clayden.org • Twitter: @jonclayden • GitHub: https://github.com/ jonclayden • TractoR: http://www.tractor- mri.org.uk