2016-03-31 10 views
-1

gibt es ein Beispiel für das Plotten volumetrischen Slice in Ilnumerics verwenden Community-Version. Dies ist ein Beispiel, das ich von Matlab Website bekam:Suchen Sie zum Beispiel für das Plotten Volumetric Slice in Ilnumerics

Volumetric slice image example of matlab

Ich habe Array X, Y, Z wie posistions und V (Geschwindigkeit) als Wert für die Farb Plotten. Alles, was ich getan habe, ist Ilpoints zu verwenden, um das V in der Position X, Y, Z nicht zu zeichnen. Hier ist mein-Code und das Ergebnis,

ILArray<float> plotXY = ILMath.zeros<float>(3, XcoordinateXY.Length); 
     plotXY["0;:"] = ILMath.tosingle(SurfaceXY[":;:;1"]); 
     plotXY["1;:"] = ILMath.tosingle(SurfaceXY[":;:;2"]); 
     plotXY["2;:"] = ILMath.tosingle(SurfaceXY[":;:;3"]); 

     ILArray<float> ColorMap = ILMath.tosingle(SurfaceXY[":;:;0"]); 

var ilsurfaceplotXY = new ILPoints() 
     { 

      /*Wireframe = { Color = Color.FromArgb(50, Color.LightGray) }, 
      Colormap = new ILColormap(dataXY), 
      Children = { new ILColorbar() }*/ 
      Positions = plotXY, 
      Colors = cm.Map(ColorMap).T, 
      Color = null 
     }; 

Hier ist Code für die Anzeige:

var scene = new ILScene(); 
     scene.Add(
       new ILPlotCube 
       { 
        TwoDMode = false, 
        Axes = 
        { 

         XAxis = 
         { 
          Label = { Text = "UTM X (Km)" }, 
          GridMajor = 
          { 
           DashStyle = DashStyle.Dashed, 
           Color = Color.DarkGray, 
           Width = 1 

          } 
         }, 
         YAxis = 
         { 
          Label = { Text = "UTM Y (Km)" }, 
          GridMajor = 
          { 
           DashStyle = DashStyle.Dashed, 
           Color = Color.DarkGray, 
           Width = 1 
          } 
         }, 
         ZAxis = 
         { 
          Label = { Text = "DEPTH (Km)" }, 
          GridMajor = 
          { 
           DashStyle = DashStyle.Dashed, 
           Color = Color.DarkGray, 
           Width = 1 
          } 
         } 
        }, 

        Children = { ilsurfaceplotXY, ilsurfaceplotXZ, ilsurfaceplotYZ }, 
       } 
      ); 

     this.ilPanel1.Scene = scene; 
     this.ilPanel1.Scene.Configure(); 
     this.ilPanel1.Refresh(); 

Und hier ist ein Bilder.

Result Image

Es tut mir leid das Bild in der Verbindung ist.

Antwort

1

In Bezug auf die Visualisierung kann dies mit regular surfaces, imagesc plots, oder die neue schnelle Oberfläche in der Drawing2 Toolbox getan werden. Sie ermöglichen alle X-, Y- und Z-Werte sowie eine Farbe für jeden Gitterpunkt oder jede Kachel.

In Bezug auf die Berechnung der Punkte: Es scheint, dass Sie nur Punkte aus der verfügbaren Menge auswählen. Es wäre viel besser, zwischen diesen Punkten zu interpolieren. Die Interpolations-Toolbox bietet Funktionen für die Interpolation von gerasterten und gestreuten Daten. (In Ihrem Fall scheinen die Daten gerastert zu sein?). Dies erlaubt es Scheiben in beliebiger Orientierung/Winkel zu haben. Die Interpolations-Toolbox interpoliert die Positionen der Schichtgitterpunkte sowie die Werte für die Farben.

Aus online example:

Interpolation and visualization of sliced data from volumes

Der Aufbau der horizontalen Scheiben wie folgt durchgeführt wird:

ILArray<float> C; 
for (int i = 0; i < m_nrSlices; i += m_nrSlices/4) { 
    C = m_V[":",":", i]; 
    pc1.Add(new ILSurface(grid + i, C, colormap: Colormaps.Bone) 
    { 
     Wireframe = { Visible = false }, 
    }); 

}

Hier m_V ist Ihr 3D-Datensatz, so behandelt, als 3D-Array. pc ist der Plotwürfel. Die Flächen werden einfach dem Plotwürfel hinzugefügt. Die Punkte des roten interpolierten Bereich werden dynamisch berechnet, wenn der Benutzer die roten Kugeln bewegt:

// Points on the cutting area are considered scattered points, because the area is not (necessarily) plain. However, V 
// is a grid. interp3s interpolates the scattered points very efficiently. 
// Note how the shape of the coordinate arrays Xn, Yn and Zn is not important. interp3s takes their elements in sequential order. 
// The output is a vector of interpolated values. (We gonna reshape it below.) 
ILArray < float> Z = Interpolation.interp3s(m_V, m_x, m_x, m_x, m_Xn, m_Yn, Zn, method: InterpolationMethod.cubic); 

// let's plot! We get a reference to the fast surface 
var fsurf = ilPanel1.Scene.First<ILFastSurface>("dynslice"); 
if (fsurf != null) { 
    // first time setup only: provide the full coordinates of X and V. Here it is sufficient to provide grid vectors. 
    if (fsurf.Cols == 0) { 
     fsurf.Update(X: m_xn * res, Y: m_xn * res, Z: Zn * res, C: ILMath.reshape(Z, Zn.S), colormap: Colormaps.Hot); 
    } else { 
     // the grid was configured already and did not change. we save some recomputing by ommiting the X and Y coordinates, prevent from reshaping buffers. 
     fsurf.Update(Z: Zn * res, C: ILMath.reshape(Z, Zn.S), colormap: Colormaps.Hot); 
    } 
} 
fsurf.Configure(); 
ilPanel1.Refresh(); 

Zu den Details gehen in ist für SO außerhalb des Gültigkeitsbereichs. Sie können das Beispiel herunterladen und auf Ihrem Computer ausführen. Sie benötigen jedoch eine recent version von ILNumerics.

EDIT: Axis Aligned Slices wie in der von Ihnen bereitgestellten Plot sind natürlich nur eine Subdomain. sie Erzeugen arbeitet in der gleichen Art und Weise: enter image description here

+0

Das ist, was ich auf der Suche for..thankyou so viel @Haymo Kutschbach – Cas

+0

Die Art und Weise, Dank zu sagen an SO upvote und Marke als Antwort;) –