Skip to content

Commit a267e5c

Browse files
committed
small updates
1 parent 48ecb72 commit a267e5c

File tree

6 files changed

+876
-1045
lines changed

6 files changed

+876
-1045
lines changed

QMRITools/Kernel/FasciculationTools.wl

+16-2
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,19 @@ EvaluateActivation[act_,dat_,mn_,tr_,actS_]:=Module[{datD,actD,actSD,mnD,trD,sc,
428428

429429
Row[{Show[
430430
ListLinePlot[Thread[{ddat,sig}],PlotStyle->Black,PlotMarkers->Automatic,PlotRange->{0,1.1 Max@sig},ImageSize->500,
431-
GridLines->{{{dyn,Directive[Black,Thick]}},{{mean,Directive[Black,Thick]},{tresh[[1]],Red},{tresh[[2]],Directive[Thick,Gray]},{tresh[[3]],Directive[Thick,Gray,Dashed]}}}],
431+
GridLines->If[grid,{
432+
{{dyn,Directive[Black,Thick]}},
433+
{{mean,Directive[Black,Thick]},
434+
{tresh[[1]],Directive[Red,Thick]},
435+
{tresh[[2]],Directive[Thick,RGBColor[0.812807, 0.518694, 0.303459], Dashed]},
436+
{tresh[[3]],Directive[Thick,RGBColor[0.253651, 0.344893, 0.558151], Dashed]}}},
437+
None
438+
]
439+
],
440+
Graphics[{
441+
RGBColor[0.812807, 0.518694, 0.303459],Line[{{0,tresh[[2]]},{Length@sig,tresh[[2]]}}],
442+
RGBColor[0.253651, 0.344893, 0.558151],Line[{{0,tresh[[2]]},{Length@sig,tresh[[2]]}}]
443+
}],
432444
ListPlot[Pick[Thread[{ddat,sig}],actt,1],PlotStyle->Red,PlotMarkers->{Automatic,10}],
433445
ListPlot[Pick[Thread[{ddat,sig}],actSt,1],PlotStyle->Green,PlotMarkers->{Automatic,10}]]
434446
,
@@ -447,7 +459,9 @@ EvaluateActivation[act_,dat_,mn_,tr_,actS_]:=Module[{datD,actD,actSD,mnD,trD,sc,
447459
,Delimiter
448460
,{{alpha, 0.5, "Opacity"},0,1}
449461
,{{crs, True,"Show cross"},{True,False}}
450-
462+
,Delimiter
463+
,{{grid,False},{True,False}}
464+
,Row[{Dynamic[{z,y,x}]}]
451465
,
452466
{zz,ControlType->None},{dd,ControlType->None},{xx,ControlType->None},{yy,ControlType->None},
453467
{max,ControlType->None},{pos,ControlType->None},{l,1,ControlType->None},

QMRITools/Kernel/GeneralTools.wl

+3-7
Original file line numberDiff line numberDiff line change
@@ -731,22 +731,18 @@ DataToVector[datai_, maski_] := Module[{data, mask, depthd, depthm, depth, dimm,
731731

732732
(*Dimensions must be equal*)
733733
If[ dimd =!= dimm, Return@Message[DataToVector::mask, dimd, dimm]];
734-
(*
734+
735735
(*Flatten the data*)
736736
data = If[depthd == 4,
737737
Flatten[RotateDimensionsLeft[Transpose[data]], 2],
738738
If[depthd == 3 && depth == 1,
739739
Flatten[RotateDimensionsLeft[data], 1],
740740
Flatten[data]
741741
]
742-
];*)
743-
744-
sp = SparseArray[mask data];
745-
cor = sp["ExplicitPositions"];
746-
val = sp["ExplicitValues"];
742+
];
747743

748744
(*get the data and positions there mask is 1*)
749-
{val , {dimd, cor}}
745+
{Pick[data, Round[Flatten[mask]], 1] , {dimd, Position[mask, 1]}}
750746
]
751747

752748

0 commit comments

Comments
 (0)