Repository: Alpine-DAV/ascent
Pull request #1499: Fix uniform grid to account 2D slices along all axis
Author: login: nicolemarsaglia
Created: 2025-04-10T17:42:35Z | Merged: 2025-04-11T00:39:44Z

Previously only took into account slices along the Z-axis, now we can do slices along any axis. 


Diff:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c2b8c417f..0c71c99ba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,6 +41,7 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s
 - Changed the replay utility's binary names such that `replay_ser` is now `ascent_replay` and `raplay_mpi` is now `ascent_replay_mpi`. This will help prevent potential name collisions with other tools that also have replay utilities.
 
 ### Fixed
+- Fixed Uniform Grid bug only accepting 2D slices along the Z-axis.
 - Resolved a few cases where MPI_COMM_WORLD was used instead instead of the selected MPI communicator.
 - Resolved a bug where a sharing a coordset between multiple polytopal topologies would corrupt mesh processing.
 - Fixed a bug with Cinema resource output that could lead to corrupted html results.
diff --git a/src/libs/ascent/runtimes/flow_filters/ascent_runtime_vtkh_filters.cpp b/src/libs/ascent/runtimes/flow_filters/ascent_runtime_vtkh_filters.cpp
index 1e20b4c36..bd4b28196 100644
--- a/src/libs/ascent/runtimes/flow_filters/ascent_runtime_vtkh_filters.cpp
+++ b/src/libs/ascent/runtimes/flow_filters/ascent_runtime_vtkh_filters.cpp
@@ -3829,6 +3829,10 @@ VTKHUniformGrid::execute()
         v_dims[1] = get_float64(n_dims["j"], data_object);
       if(n_dims.has_path("k"))
         v_dims[2] = get_float64(n_dims["k"], data_object);
+
+      v_dims[0] = (v_dims[0] > 0) ? (v_dims[0]) : 1;
+      v_dims[1] = (v_dims[1] > 0) ? (v_dims[1]) : 1;
+      v_dims[2] = (v_dims[2] > 0) ? (v_dims[2]) : 1;
     }
     if(params().has_path("origin"))
     {
diff --git a/src/libs/vtkh/filters/UniformGrid.cpp b/src/libs/vtkh/filters/UniformGrid.cpp
index 35c5c14bf..2ea255740 100644
--- a/src/libs/vtkh/filters/UniformGrid.cpp
+++ b/src/libs/vtkh/filters/UniformGrid.cpp
@@ -29,6 +29,8 @@ using vec2_64  = vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64,2>>;
 using Vec2d    = vtkm::Vec<double, 2>;
 using Vec3d    = vtkm::Vec<double, 3>;
 
+#define _DEBUG 0
+
 namespace vtkh
 {
 
@@ -41,15 +43,19 @@ MakeEmptyField(std::string field_name , vtkm::Id field_id, Vec3f dims, vtkm::con
   int num_values = 0;
   if(assoc == vtkm::cont::Field::Association::Cells) //cell centered field
   {
-    num_values = (dims[0]-1)*(dims[1]-1);
-    if(dims[2] > 1)
-      num_values = num_values*(dims[2]-1);
+    int nx = (dims[0] > 1) ? (dims[0] - 1) : 1;
+    int ny = (dims[1] > 1) ? (dims[1] - 1) : 1;
+    int nz = (dims[2] > 1) ? (dims[2] - 1) : 1;
+
+    num_values = nx * ny * nz;
   }
   else
   {
-    num_values = dims[0]*dims[1];
-    if(dims[2] > 1)
-      num_values = num_values*dims[2];
+    int nx = (dims[0] > 0) ? (dims[0]) : 1;
+    int ny = (dims[1] > 0) ? (dims[1]) : 1;
+    int nz = (dims[2] > 0) ? (dims[2]) : 1;
+
+    num_values = nx * ny * nz;
   }
 
   if(field_id == 0)
@@ -220,9 +226,9 @@ class GlobalReduceField
       for(int j = 0; j < num_points; ++j)
       {
         if(mask_portal.Get(j) == 0)
-	{
+	      {
           l_rank_mask[j] = par_rank;
-	}
+	      }
       }
 
       //take Max to figure out which ranks own which points
diff --git a/src/tests/_baseline_images/tout_uniform_sample_in_x100.png b/src/tests/_baseline_images/tout_uniform_sample_in_x100.png
new file mode 100644
index 000000000..d726bbd91
Binary files /dev/null and b/src/tests/_baseline_images/tout_uniform_sample_in_x100.png differ
diff --git a/src/tests/_baseline_images/tout_uniform_sample_in_y100.png b/src/tests/_baseline_images/tout_uniform_sample_in_y100.png
new file mode 100644
index 000000000..bc3f3aafd
Binary files /dev/null and b/src/tests/_baseline_images/tout_uniform_sample_in_y100.png differ
diff --git a/src/tests/ascent/t_ascent_uniform_grid.cpp b/src/tests/ascent/t_ascent_uniform_grid.cpp
index 2f5f4273c..2c5c7f2b9 100644
--- a/src/tests/ascent/t_ascent_uniform_grid.cpp
+++ b/src/tests/ascent/t_ascent_uniform_grid.cpp
@@ -33,6 +33,188 @@ using namespace ascent;
 
 index_t EXAMPLE_MESH_SIDE_DIM = 20;
 
+//-----------------------------------------------------------------------------
+TEST(ascent_uniform_regular_grid, test_uniform_grid_slice_along_y)
+{
+    Node n;
+    ascent::about(n);
+    // only run this test if ascent was built with vtkm support
+    if(n["runtimes/ascent/vtkm/status"].as_string() == "disabled")
+    {
+        ASCENT_INFO("Ascent vtkm support disabled, skipping test");
+        return;
+    }
+
+    //
+    // Create an example mesh.
+    //
+    Node data, verify_info;
+    conduit::blueprint::mesh::examples::braid("hexs",
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              data);
+    EXPECT_TRUE(conduit::blueprint::mesh::verify(data,verify_info));
+
+    ASCENT_INFO("Testing sampling a smaller regular grid of hexahedron input");
+
+
+    string output_path = prepare_output_dir();
+    string output_file = conduit::utils::join_file_path(output_path,"tout_uniform_sample_in_y");
+
+    // remove old images before rendering
+    remove_test_image(output_file);
+
+    data["state/cycle"] = 100;
+    //
+    // Create the actions.
+    //
+
+    conduit::Node pipelines;
+    // pipeline 1
+    pipelines["pl1/f1/type"] = "uniform_grid";
+    conduit::Node &params = pipelines["pl1/f1/params"];
+    params["field"] = "braid";      
+    params["dims/i"] = EXAMPLE_MESH_SIDE_DIM-10;
+    params["dims/k"] = EXAMPLE_MESH_SIDE_DIM-10;
+    params["dims/j"] = 0;
+    params["invalid_value"] = -10.0;      
+
+    conduit::Node scenes;
+    scenes["s1/plots/p1/type"]         = "pseudocolor";
+    scenes["s1/plots/p1/field"] = "braid";
+    scenes["s1/plots/p1/pipeline"] = "pl1";
+    scenes["s1/renders/r1/camera/elevation"] = 30;
+
+    scenes["s1/renders/r1/image_prefix"] = output_file;
+
+    conduit::Node actions;
+    // add the pipeline
+    conduit::Node &add_pipelines = actions.append();
+    add_pipelines["action"] = "add_pipelines";
+    add_pipelines["pipelines"] = pipelines;
+    // add the scenes
+    conduit::Node &add_scenes= actions.append();
+    add_scenes["action"] = "add_scenes";
+    add_scenes["scenes"] = scenes;
+    //add the extracts
+//    conduit::Node &add_extracts= actions.append();
+//    add_extracts["action"] = "add_extracts";
+//    conduit::Node &extracts = add_extracts["extracts"];
+//    extracts["e1/type"] = "relay";
+//    extracts["e1/pipeline"] = "pl1";
+//    extracts["e1/params/path"] = output_file + "_blueprint";
+//    extracts["e1/params/protocol"] = "hdf5";
+
+    //
+    // Run Ascent
+    //
+
+    Ascent ascent;
+
+    Node ascent_opts;
+    ascent_opts["runtime/type"] = "ascent";
+    ascent.open(ascent_opts);
+    ascent.publish(data);
+    ascent.execute(actions);
+    ascent.close();
+
+    // check that we created an image
+    EXPECT_TRUE(check_test_image(output_file));
+    std::string msg = "An example of using the uniform grid filter.";
+    ASCENT_ACTIONS_DUMP(actions,output_file,msg);
+}
+//-----------------------------------------------------------------------------
+TEST(ascent_uniform_regular_grid, test_uniform_grid_sample_along_x)
+{
+    Node n;
+    ascent::about(n);
+    // only run this test if ascent was built with vtkm support
+    if(n["runtimes/ascent/vtkm/status"].as_string() == "disabled")
+    {
+        ASCENT_INFO("Ascent vtkm support disabled, skipping test");
+        return;
+    }
+
+    //
+    // Create an example mesh.
+    //
+    Node data, verify_info;
+    conduit::blueprint::mesh::examples::braid("hexs",
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              data);
+    EXPECT_TRUE(conduit::blueprint::mesh::verify(data,verify_info));
+
+    ASCENT_INFO("Testing sampling a smaller regular grid of hexahedron input");
+
+
+    string output_path = prepare_output_dir();
+    string output_file = conduit::utils::join_file_path(output_path,"tout_uniform_sample_in_x");
+
+    // remove old images before rendering
+    remove_test_image(output_file);
+
+    data["state/cycle"] = 100;
+    //
+    // Create the actions.
+    //
+
+    conduit::Node pipelines;
+    // pipeline 1
+    pipelines["pl1/f1/type"] = "uniform_grid";
+    conduit::Node &params = pipelines["pl1/f1/params"];
+    params["field"] = "braid";      
+    params["dims/j"] = EXAMPLE_MESH_SIDE_DIM-10;
+    params["dims/k"] = EXAMPLE_MESH_SIDE_DIM-10;
+    //params["dims/j"] = 0;
+    params["invalid_value"] = -10.0;      
+
+    conduit::Node scenes;
+    scenes["s1/plots/p1/type"]         = "pseudocolor";
+    scenes["s1/plots/p1/field"] = "braid";
+    scenes["s1/plots/p1/pipeline"] = "pl1";
+    scenes["s1/renders/r1/camera/azimuth"] = 90;
+
+    scenes["s1/renders/r1/image_prefix"] = output_file;
+
+    conduit::Node actions;
+    // add the pipeline
+    conduit::Node &add_pipelines = actions.append();
+    add_pipelines["action"] = "add_pipelines";
+    add_pipelines["pipelines"] = pipelines;
+    // add the scenes
+    conduit::Node &add_scenes= actions.append();
+    add_scenes["action"] = "add_scenes";
+    add_scenes["scenes"] = scenes;
+    //add the extracts
+//    conduit::Node &add_extracts= actions.append();
+//    add_extracts["action"] = "add_extracts";
+//    conduit::Node &extracts = add_extracts["extracts"];
+//    extracts["e1/type"] = "relay";
+//    extracts["e1/pipeline"] = "pl1";
+//    extracts["e1/params/path"] = output_file + "_blueprint";
+//    extracts["e1/params/protocol"] = "hdf5";
+
+    //
+    // Run Ascent
+    //
+
+    Ascent ascent;
+
+    Node ascent_opts;
+    ascent_opts["runtime/type"] = "ascent";
+    ascent.open(ascent_opts);
+    ascent.publish(data);
+    ascent.execute(actions);
+    ascent.close();
+
+    // check that we created an image
+    EXPECT_TRUE(check_test_image(output_file));
+    std::string msg = "An example of using the uniform grid filter.";
+    ASCENT_ACTIONS_DUMP(actions,output_file,msg);
+}
 //-----------------------------------------------------------------------------
 TEST(ascent_uniform_regular_grid, test_uniform_grid_smaller_in_i)
 {


Reviews:
user: login: emily-howell
body: Would be nice to clean up the commented out sections in the code but otherwise this looks good to me.

Probably can't merge until the CI is fixed 
state: APPROVED
author_association: MEMBER
submitted_at: 2025-04-11T00:08:13Z
user: login: nicolemarsaglia
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-11T00:41:53Z

Review comments:
diff_hunk: @@ -33,6 +33,188 @@ using namespace ascent;
 
 index_t EXAMPLE_MESH_SIDE_DIM = 20;
 
+//-----------------------------------------------------------------------------
+TEST(ascent_uniform_regular_grid, test_uniform_grid_slice_along_y)
+{
+    Node n;
+    ascent::about(n);
+    // only run this test if ascent was built with vtkm support
+    if(n["runtimes/ascent/vtkm/status"].as_string() == "disabled")
+    {
+        ASCENT_INFO("Ascent vtkm support disabled, skipping test");
+        return;
+    }
+
+    //
+    // Create an example mesh.
+    //
+    Node data, verify_info;
+    conduit::blueprint::mesh::examples::braid("hexs",
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              data);
+    EXPECT_TRUE(conduit::blueprint::mesh::verify(data,verify_info));
+
+    ASCENT_INFO("Testing sampling a smaller regular grid of hexahedron input");
+
+
+    string output_path = prepare_output_dir();
+    string output_file = conduit::utils::join_file_path(output_path,"tout_uniform_sample_in_y");
+
+    // remove old images before rendering
+    remove_test_image(output_file);
+
+    data["state/cycle"] = 100;
+    //
+    // Create the actions.
+    //
+
+    conduit::Node pipelines;
+    // pipeline 1
+    pipelines["pl1/f1/type"] = "uniform_grid";
+    conduit::Node &params = pipelines["pl1/f1/params"];
+    params["field"] = "braid";      
+    params["dims/i"] = EXAMPLE_MESH_SIDE_DIM-10;
+    params["dims/k"] = EXAMPLE_MESH_SIDE_DIM-10;
+    params["dims/j"] = 0;
+    params["invalid_value"] = -10.0;      
+
+    conduit::Node scenes;
+    scenes["s1/plots/p1/type"]         = "pseudocolor";
+    scenes["s1/plots/p1/field"] = "braid";
+    scenes["s1/plots/p1/pipeline"] = "pl1";
+    scenes["s1/renders/r1/camera/elevation"] = 30;
+
+    scenes["s1/renders/r1/image_prefix"] = output_file;
+
+    conduit::Node actions;
+    // add the pipeline
+    conduit::Node &add_pipelines = actions.append();
+    add_pipelines["action"] = "add_pipelines";
+    add_pipelines["pipelines"] = pipelines;
+    // add the scenes
+    conduit::Node &add_scenes= actions.append();
+    add_scenes["action"] = "add_scenes";
+    add_scenes["scenes"] = scenes;
+    //add the extracts
+//    conduit::Node &add_extracts= actions.append();
+//    add_extracts["action"] = "add_extracts";
+//    conduit::Node &extracts = add_extracts["extracts"];
+//    extracts["e1/type"] = "relay";
+//    extracts["e1/pipeline"] = "pl1";
+//    extracts["e1/params/path"] = output_file + "_blueprint";
+//    extracts["e1/params/protocol"] = "hdf5";
+
+    //
+    // Run Ascent
+    //
+
+    Ascent ascent;
+
+    Node ascent_opts;
+    ascent_opts["runtime/type"] = "ascent";
+    ascent.open(ascent_opts);
+    ascent.publish(data);
+    ascent.execute(actions);
+    ascent.close();
+
+    // check that we created an image
+    EXPECT_TRUE(check_test_image(output_file));
+    std::string msg = "An example of using the uniform grid filter.";
+    ASCENT_ACTIONS_DUMP(actions,output_file,msg);
+}
+//-----------------------------------------------------------------------------
+TEST(ascent_uniform_regular_grid, test_uniform_grid_sample_along_x)
+{
+    Node n;
+    ascent::about(n);
+    // only run this test if ascent was built with vtkm support
+    if(n["runtimes/ascent/vtkm/status"].as_string() == "disabled")
+    {
+        ASCENT_INFO("Ascent vtkm support disabled, skipping test");
+        return;
+    }
+
+    //
+    // Create an example mesh.
+    //
+    Node data, verify_info;
+    conduit::blueprint::mesh::examples::braid("hexs",
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              data);
+    EXPECT_TRUE(conduit::blueprint::mesh::verify(data,verify_info));
+
+    ASCENT_INFO("Testing sampling a smaller regular grid of hexahedron input");
+
+
+    string output_path = prepare_output_dir();
+    string output_file = conduit::utils::join_file_path(output_path,"tout_uniform_sample_in_x");
+
+    // remove old images before rendering
+    remove_test_image(output_file);
+
+    data["state/cycle"] = 100;
+    //
+    // Create the actions.
+    //
+
+    conduit::Node pipelines;
+    // pipeline 1
+    pipelines["pl1/f1/type"] = "uniform_grid";
+    conduit::Node &params = pipelines["pl1/f1/params"];
+    params["field"] = "braid";      
+    params["dims/j"] = EXAMPLE_MESH_SIDE_DIM-10;
+    params["dims/k"] = EXAMPLE_MESH_SIDE_DIM-10;
+    //params["dims/j"] = 0;
+    params["invalid_value"] = -10.0;      
+
+    conduit::Node scenes;
+    scenes["s1/plots/p1/type"]         = "pseudocolor";
+    scenes["s1/plots/p1/field"] = "braid";
+    scenes["s1/plots/p1/pipeline"] = "pl1";
+    scenes["s1/renders/r1/camera/azimuth"] = 90;
+
+    scenes["s1/renders/r1/image_prefix"] = output_file;
+
+    conduit::Node actions;
+    // add the pipeline
+    conduit::Node &add_pipelines = actions.append();
+    add_pipelines["action"] = "add_pipelines";
+    add_pipelines["pipelines"] = pipelines;
+    // add the scenes
+    conduit::Node &add_scenes= actions.append();
+    add_scenes["action"] = "add_scenes";
+    add_scenes["scenes"] = scenes;
+    //add the extracts
+//    conduit::Node &add_extracts= actions.append();
+//    add_extracts["action"] = "add_extracts";
+//    conduit::Node &extracts = add_extracts["extracts"];
+//    extracts["e1/type"] = "relay";
+//    extracts["e1/pipeline"] = "pl1";
+//    extracts["e1/params/path"] = output_file + "_blueprint";
+//    extracts["e1/params/protocol"] = "hdf5";
path: src/tests/ascent/t_ascent_uniform_grid.cpp
user: login: emily-howell
body: Would maybe clean this up

```suggestion
```
created_at: 2025-04-11T00:06:07Z
author_association: MEMBER
diff_hunk: @@ -33,6 +33,188 @@ using namespace ascent;
 
 index_t EXAMPLE_MESH_SIDE_DIM = 20;
 
+//-----------------------------------------------------------------------------
+TEST(ascent_uniform_regular_grid, test_uniform_grid_slice_along_y)
+{
+    Node n;
+    ascent::about(n);
+    // only run this test if ascent was built with vtkm support
+    if(n["runtimes/ascent/vtkm/status"].as_string() == "disabled")
+    {
+        ASCENT_INFO("Ascent vtkm support disabled, skipping test");
+        return;
+    }
+
+    //
+    // Create an example mesh.
+    //
+    Node data, verify_info;
+    conduit::blueprint::mesh::examples::braid("hexs",
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              data);
+    EXPECT_TRUE(conduit::blueprint::mesh::verify(data,verify_info));
+
+    ASCENT_INFO("Testing sampling a smaller regular grid of hexahedron input");
+
+
+    string output_path = prepare_output_dir();
+    string output_file = conduit::utils::join_file_path(output_path,"tout_uniform_sample_in_y");
+
+    // remove old images before rendering
+    remove_test_image(output_file);
+
+    data["state/cycle"] = 100;
+    //
+    // Create the actions.
+    //
+
+    conduit::Node pipelines;
+    // pipeline 1
+    pipelines["pl1/f1/type"] = "uniform_grid";
+    conduit::Node &params = pipelines["pl1/f1/params"];
+    params["field"] = "braid";      
+    params["dims/i"] = EXAMPLE_MESH_SIDE_DIM-10;
+    params["dims/k"] = EXAMPLE_MESH_SIDE_DIM-10;
+    params["dims/j"] = 0;
+    params["invalid_value"] = -10.0;      
+
+    conduit::Node scenes;
+    scenes["s1/plots/p1/type"]         = "pseudocolor";
+    scenes["s1/plots/p1/field"] = "braid";
+    scenes["s1/plots/p1/pipeline"] = "pl1";
+    scenes["s1/renders/r1/camera/elevation"] = 30;
+
+    scenes["s1/renders/r1/image_prefix"] = output_file;
+
+    conduit::Node actions;
+    // add the pipeline
+    conduit::Node &add_pipelines = actions.append();
+    add_pipelines["action"] = "add_pipelines";
+    add_pipelines["pipelines"] = pipelines;
+    // add the scenes
+    conduit::Node &add_scenes= actions.append();
+    add_scenes["action"] = "add_scenes";
+    add_scenes["scenes"] = scenes;
+    //add the extracts
+//    conduit::Node &add_extracts= actions.append();
+//    add_extracts["action"] = "add_extracts";
+//    conduit::Node &extracts = add_extracts["extracts"];
+//    extracts["e1/type"] = "relay";
+//    extracts["e1/pipeline"] = "pl1";
+//    extracts["e1/params/path"] = output_file + "_blueprint";
+//    extracts["e1/params/protocol"] = "hdf5";
path: src/tests/ascent/t_ascent_uniform_grid.cpp
user: login: emily-howell
body: Also here

```suggestion
```
created_at: 2025-04-11T00:06:34Z
author_association: MEMBER
diff_hunk: @@ -33,6 +33,188 @@ using namespace ascent;
 
 index_t EXAMPLE_MESH_SIDE_DIM = 20;
 
+//-----------------------------------------------------------------------------
+TEST(ascent_uniform_regular_grid, test_uniform_grid_slice_along_y)
+{
+    Node n;
+    ascent::about(n);
+    // only run this test if ascent was built with vtkm support
+    if(n["runtimes/ascent/vtkm/status"].as_string() == "disabled")
+    {
+        ASCENT_INFO("Ascent vtkm support disabled, skipping test");
+        return;
+    }
+
+    //
+    // Create an example mesh.
+    //
+    Node data, verify_info;
+    conduit::blueprint::mesh::examples::braid("hexs",
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              data);
+    EXPECT_TRUE(conduit::blueprint::mesh::verify(data,verify_info));
+
+    ASCENT_INFO("Testing sampling a smaller regular grid of hexahedron input");
+
+
+    string output_path = prepare_output_dir();
+    string output_file = conduit::utils::join_file_path(output_path,"tout_uniform_sample_in_y");
+
+    // remove old images before rendering
+    remove_test_image(output_file);
+
+    data["state/cycle"] = 100;
+    //
+    // Create the actions.
+    //
+
+    conduit::Node pipelines;
+    // pipeline 1
+    pipelines["pl1/f1/type"] = "uniform_grid";
+    conduit::Node &params = pipelines["pl1/f1/params"];
+    params["field"] = "braid";      
+    params["dims/i"] = EXAMPLE_MESH_SIDE_DIM-10;
+    params["dims/k"] = EXAMPLE_MESH_SIDE_DIM-10;
+    params["dims/j"] = 0;
+    params["invalid_value"] = -10.0;      
+
+    conduit::Node scenes;
+    scenes["s1/plots/p1/type"]         = "pseudocolor";
+    scenes["s1/plots/p1/field"] = "braid";
+    scenes["s1/plots/p1/pipeline"] = "pl1";
+    scenes["s1/renders/r1/camera/elevation"] = 30;
+
+    scenes["s1/renders/r1/image_prefix"] = output_file;
+
+    conduit::Node actions;
+    // add the pipeline
+    conduit::Node &add_pipelines = actions.append();
+    add_pipelines["action"] = "add_pipelines";
+    add_pipelines["pipelines"] = pipelines;
+    // add the scenes
+    conduit::Node &add_scenes= actions.append();
+    add_scenes["action"] = "add_scenes";
+    add_scenes["scenes"] = scenes;
+    //add the extracts
+//    conduit::Node &add_extracts= actions.append();
+//    add_extracts["action"] = "add_extracts";
+//    conduit::Node &extracts = add_extracts["extracts"];
+//    extracts["e1/type"] = "relay";
+//    extracts["e1/pipeline"] = "pl1";
+//    extracts["e1/params/path"] = output_file + "_blueprint";
+//    extracts["e1/params/protocol"] = "hdf5";
+
+    //
+    // Run Ascent
+    //
+
+    Ascent ascent;
+
+    Node ascent_opts;
+    ascent_opts["runtime/type"] = "ascent";
+    ascent.open(ascent_opts);
+    ascent.publish(data);
+    ascent.execute(actions);
+    ascent.close();
+
+    // check that we created an image
+    EXPECT_TRUE(check_test_image(output_file));
+    std::string msg = "An example of using the uniform grid filter.";
+    ASCENT_ACTIONS_DUMP(actions,output_file,msg);
+}
+//-----------------------------------------------------------------------------
+TEST(ascent_uniform_regular_grid, test_uniform_grid_sample_along_x)
+{
+    Node n;
+    ascent::about(n);
+    // only run this test if ascent was built with vtkm support
+    if(n["runtimes/ascent/vtkm/status"].as_string() == "disabled")
+    {
+        ASCENT_INFO("Ascent vtkm support disabled, skipping test");
+        return;
+    }
+
+    //
+    // Create an example mesh.
+    //
+    Node data, verify_info;
+    conduit::blueprint::mesh::examples::braid("hexs",
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              EXAMPLE_MESH_SIDE_DIM,
+                                              data);
+    EXPECT_TRUE(conduit::blueprint::mesh::verify(data,verify_info));
+
+    ASCENT_INFO("Testing sampling a smaller regular grid of hexahedron input");
+
+
+    string output_path = prepare_output_dir();
+    string output_file = conduit::utils::join_file_path(output_path,"tout_uniform_sample_in_x");
+
+    // remove old images before rendering
+    remove_test_image(output_file);
+
+    data["state/cycle"] = 100;
+    //
+    // Create the actions.
+    //
+
+    conduit::Node pipelines;
+    // pipeline 1
+    pipelines["pl1/f1/type"] = "uniform_grid";
+    conduit::Node &params = pipelines["pl1/f1/params"];
+    params["field"] = "braid";      
+    params["dims/j"] = EXAMPLE_MESH_SIDE_DIM-10;
+    params["dims/k"] = EXAMPLE_MESH_SIDE_DIM-10;
+    //params["dims/j"] = 0;
+    params["invalid_value"] = -10.0;      
+
+    conduit::Node scenes;
+    scenes["s1/plots/p1/type"]         = "pseudocolor";
+    scenes["s1/plots/p1/field"] = "braid";
+    scenes["s1/plots/p1/pipeline"] = "pl1";
+    scenes["s1/renders/r1/camera/azimuth"] = 90;
+
+    scenes["s1/renders/r1/image_prefix"] = output_file;
+
+    conduit::Node actions;
+    // add the pipeline
+    conduit::Node &add_pipelines = actions.append();
+    add_pipelines["action"] = "add_pipelines";
+    add_pipelines["pipelines"] = pipelines;
+    // add the scenes
+    conduit::Node &add_scenes= actions.append();
+    add_scenes["action"] = "add_scenes";
+    add_scenes["scenes"] = scenes;
+    //add the extracts
+//    conduit::Node &add_extracts= actions.append();
+//    add_extracts["action"] = "add_extracts";
+//    conduit::Node &extracts = add_extracts["extracts"];
+//    extracts["e1/type"] = "relay";
+//    extracts["e1/pipeline"] = "pl1";
+//    extracts["e1/params/path"] = output_file + "_blueprint";
+//    extracts["e1/params/protocol"] = "hdf5";
path: src/tests/ascent/t_ascent_uniform_grid.cpp
user: login: nicolemarsaglia
body: @emily-howell ya, it's handy when you need to debug, but could do with only one copy for reference. I'll clean it up at some point, probably the next time I need to fix uniform grid. 
created_at: 2025-04-11T00:41:53Z
author_association: CONTRIBUTOR

PR comments:
user: login: emily-howell
created_at: 2025-04-10T20:34:48Z
body: Should a new test be added to exercise this change?
author_association: MEMBER
user: login: nicolemarsaglia
created_at: 2025-04-10T23:59:03Z
body: @emily-howell ok ready for some eyes when you get a chance
author_association: CONTRIBUTOR