Skip to content

Commit

Permalink
intensity scaler
Browse files Browse the repository at this point in the history
  • Loading branch information
xieguigang committed Jan 17, 2024
1 parent 27efd0f commit 81931cc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Rscript/Library/mzkit_app/src/mzplot/MsImaging.vb
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,14 @@ Module MsImaging
Return raster
End Function

<ExportAPI("intensityFilter")>
Public Function intensityFilter(<RRawVectorArgument> x As Object, filter As RasterPipeline, Optional env As Environment = Nothing) As Object
Return env.EvaluateFramework(Of SingleIonLayer, SingleIonLayer)(x,
eval:=Function(layer)
Return filter(layer)
End Function)
End Function

''' <summary>
''' MS-imaging of the MSI summary data result.
''' </summary>
Expand Down
8 changes: 6 additions & 2 deletions dist/workbench/ms_imaging/3d/volume.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
require(mzkit);

imports "MSI" from "mzkit";
imports "MsImaging" from "mzplot";

options(memory.load = "max");

let power = MsImaging::parseFilters("power(2)");
let rawfiles = list.files("\\192.168.1.254\backup3\项目以外内容\2024\动物器官3D重建测试\raw_mzPack\single_ions\413.0958", pattern = "*.dat");
let z = as.numeric(basename(rawfiles));

rawfiles = rawfiles[order(z)];

let load = lapply(rawfiles, path -> readBin(path, what = "msi_layer"));

let load = rawfiles
|> lapply(path -> readBin(path, what = "msi_layer"))
|> intensityFilter(power)
;

MSI::z_volume(
layers = load,
Expand Down
1 change: 1 addition & 0 deletions src/visualize/MsImaging/Blender/Scaler/Scaler.vb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ Namespace Blender.Scaler
Case "triq" : Return New TrIQScaler(pars.ElementAtOrDefault(0, 0.65))
Case "knn_fill" : Return New KNNScaler(pars.ElementAtOrDefault(0, 3), pars.ElementAtOrDefault(1, 0.65))
Case "log" : Return New LogScaler(pars.ElementAtOrDefault(0, System.Math.E))
Case "power" : Return New PowerScaler(pars.ElementAtOrDefault(0, 2))
Case Else
Throw New NotImplementedException(config.Name)
End Select
Expand Down

0 comments on commit 81931cc

Please sign in to comment.