Skip to content

Commit 2ecb8f7

Browse files
committed
Initial commit
0 parents  commit 2ecb8f7

File tree

15 files changed

+771
-0
lines changed

15 files changed

+771
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

LICENSE

+674
Large diffs are not rendered by default.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# wholebrain-examples

autoradiography/.DS_Store

6 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"tempName" : "Untitled1"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
~%2FDocuments%2FGitHub%2Fwholebrain-examples%2Fautoradiography%2Fanalysis_script.R="DCE32A03"
2+
~%2FDocuments%2FGitHub%2Fwholebrain-examples%2Fautoradiography%2Fradioactivity_sorted_by_region.csv="8BA40F83"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"collab_server" : "",
3+
"contents" : "library(wholebrain)\n\n\nmyfilter<-structure(list(alim = c(0, 118), #area limits of soma size\n threshold.range = c(7431L, 31416L), #this is the threshold range to look for speckles\n eccentricity = 1000L,#eccentricity allowed 1000 max\n Max = 13512, #display range Maximum value for 8-bit rendered\n Min = 0, #display range Minimum value for 8-bit rendered\n brain.threshold = 2364L, #threshold to find brain contour\n resize = 0.04, #resize parameter to match atlas size to pixel size\n blur = 6L, #blur of brain outline\n downsample = 0.25), #donwample factor to increase processing speed\n .Names = c(\"alim\", \"threshold.range\", \"eccentricity\", \"Max\", \"Min\", \"brain.threshold\",\n \"resize\", \"blur\", \"downsample\"))\n\n#image file to analyze\nimages<-get.images('./images')\n\n#segment speckles press ESC to continue\nseg<-segment(images, filter=myfilter)\n\n#registration\ncoord<-0.5 #mm from bregma AP\nregi<-registration(images, filter=myfilter, coordinate=0.5)\n\n#get final spreadsheet\ndataset<-inspect.registration(regi, seg, forward.warps = TRUE)\n\n#save all info so we can reproduce it.\nsave(images, seg, regi, dataset, file='radioactivity.RData')\n\n#plot 3D brain\nglassbrain(dataset)\n\n#make schematic plot\nschematic.plot(dataset)\n\n#get regions sorted according to intensity\nmean.intensity<-tapply(dataset$intensity, dataset$acronym, mean)\n#sort them\nmean.intensity<-sort(mean.intensity, decreasing= TRUE)\n#print a table with acronym and name\noutputdata<-data.frame(parent.name = name.from.acronym(get.acronym.parent(names(mean.intensity))), parent.acronym = get.acronym.parent(names(mean.intensity)), name = name.from.acronym(names(mean.intensity)), acronym = names(mean.intensity), intensity = mean.intensity)\n#write to spreadsheet file\nwrite.csv(outputdata, file = \"radioactivity_sorted_by_region.csv\", row.names=FALSE)\n\n#make a webmap into current project folder\npixel.resolution<-1 #1 micron\nmakewebmap(img = images, filter = myfilter, registration = regi, dataset = dataset, \n scale = 0.64, fluorophore = \"Radioactivity\")",
4+
"created" : 1518797870978.000,
5+
"dirty" : false,
6+
"encoding" : "UTF-8",
7+
"folds" : "",
8+
"hash" : "1049230511",
9+
"id" : "B843ADF8",
10+
"lastKnownWriteTime" : 1518810678,
11+
"last_content_update" : 1518810678391,
12+
"path" : "~/Documents/GitHub/wholebrain-examples/autoradiography/analysis_script.R",
13+
"project_path" : "analysis_script.R",
14+
"properties" : {
15+
"tempName" : "Untitled1"
16+
},
17+
"relative_order" : 1,
18+
"source_on_save" : false,
19+
"source_window" : "",
20+
"type" : "r_source"
21+
}

autoradiography/.Rproj.user/89B9672D/sdb/s-5F0EC4E/lock_file

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
virtual-session-id="93599E2"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/Users/danielfurth/Documents/GitHub/wholebrain-examples/autoradiography/analysis_script.R="25E3046F"
2+
/Users/danielfurth/Documents/GitHub/wholebrain-examples/autoradiography/radioactivity_sorted_by_region.csv="B917086E"

autoradiography/analysis_script.R

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
library(wholebrain)
2+
3+
4+
myfilter<-structure(list(alim = c(0, 118), #area limits of soma size
5+
threshold.range = c(7431L, 31416L), #this is the threshold range to look for speckles
6+
eccentricity = 1000L,#eccentricity allowed 1000 max
7+
Max = 13512, #display range Maximum value for 8-bit rendered
8+
Min = 0, #display range Minimum value for 8-bit rendered
9+
brain.threshold = 2364L, #threshold to find brain contour
10+
resize = 0.04, #resize parameter to match atlas size to pixel size
11+
blur = 6L, #blur of brain outline
12+
downsample = 0.25), #donwample factor to increase processing speed
13+
.Names = c("alim", "threshold.range", "eccentricity", "Max", "Min", "brain.threshold",
14+
"resize", "blur", "downsample"))
15+
16+
#image file to analyze
17+
images<-get.images('./images')
18+
19+
#segment speckles press ESC to continue
20+
seg<-segment(images, filter=myfilter)
21+
22+
#registration
23+
coord<-0.5 #mm from bregma AP
24+
regi<-registration(images, filter=myfilter, coordinate=0.5)
25+
26+
#get final spreadsheet
27+
dataset<-inspect.registration(regi, seg, forward.warps = TRUE)
28+
29+
#save all info so we can reproduce it.
30+
save(images, seg, regi, dataset, file='radioactivity.RData')
31+
32+
#plot 3D brain
33+
glassbrain(dataset)
34+
35+
#make schematic plot
36+
schematic.plot(dataset)
37+
38+
#get regions sorted according to intensity
39+
mean.intensity<-tapply(dataset$intensity, dataset$acronym, mean)
40+
#sort them
41+
mean.intensity<-sort(mean.intensity, decreasing= TRUE)
42+
#print a table with acronym and name
43+
outputdata<-data.frame(parent.name = name.from.acronym(get.acronym.parent(names(mean.intensity))), parent.acronym = get.acronym.parent(names(mean.intensity)), name = name.from.acronym(names(mean.intensity)), acronym = names(mean.intensity), intensity = mean.intensity)
44+
#write to spreadsheet file
45+
write.csv(outputdata, file = "radioactivity_sorted_by_region.csv", row.names=FALSE)
46+
47+
#make a webmap into current project folder
48+
pixel.resolution<-1 #1 micron
49+
makewebmap(img = images, filter = myfilter, registration = regi, dataset = dataset,
50+
scale = 0.64, fluorophore = "Radioactivity")

autoradiography/autoradiography.Rproj

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Version: 1.0
2+
3+
RestoreWorkspace: Default
4+
SaveWorkspace: Default
5+
AlwaysSaveHistory: Default
6+
7+
EnableCodeIndexing: Yes
8+
UseSpacesForTab: Yes
9+
NumSpacesForTab: 2
10+
Encoding: UTF-8
11+
12+
RnwWeave: Sweave
13+
LaTeX: pdfLaTeX
47.5 MB
Binary file not shown.

0 commit comments

Comments
 (0)