Repository: pyvista/pyvista

Issue:
`ImageData().points` raises unexpected ValueError
### Describe the bug, what's wrong, and what you expected.

`ImageData().points` raises an unexpected `ValueError`. I would have expected that an empty array be returned, which is the behaviour with `PolyData().points` and `UnstructuredGrid().points`

### Steps to reproduce the bug.

Running:
```python
import pyvista
pyvista.ImageData().points
```
Will produce:
```
Traceback (most recent call last):
  File "\pyvista\lib\site-packages\IPython\core\interactiveshell.py", line 3508, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-5-c3545438d535>", line 1, in <module>
    im.points
  File "c\pyvista\pyvista\core\grid.py", line 629, in points
    x = np.insert(np.cumsum(np.full(nx, dx)), 0, 0.0) + ox
  File "\pyvista\lib\site-packages\numpy\core\numeric.py", line 329, in full
    a = empty(shape, dtype, order)
ValueError: negative dimensions are not allowed
```

Compare this to:
```python
import pyvista
pyvista.PolyData().points  # pyvista_ndarray([], shape=(0, 3), dtype=float64)
pyvista.UnstructuredGrid().points  # pyvista_ndarray([], shape=(0, 3), dtype=float64)
```

### System Information

```shell
OS : Windows
            CPU(s) : 12
           Machine : AMD64
      Architecture : 64bit
               RAM : 31.8 GiB
       Environment : IPython
        GPU Vendor : Intel
      GPU Renderer : Intel(R) UHD Graphics 630
       GPU Version : 4.5.0 - Build 30.0.100.9864
  MathText Support : False
  Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64
  bit (AMD64)]
           pyvista : 0.42.dev0
               vtk : 9.2.6
             numpy : 1.25.1
        matplotlib : 3.7.2
            scooby : 0.7.2
             pooch : v1.7.0
           imageio : 2.31.1
           IPython : 8.14.0
          colorcet : 3.0.1
           cmocean : v3.0.3
        ipyvtklink : 0.2.3
        ipywidgets : 7.7.5
             scipy : 1.11.1
              tqdm : 4.65.0
            meshio : 5.3.4
        jupyterlab : 4.0.3
         pythreejs : 2.4.2
    pytest_pyvista : 0.1.8
             trame : 2.5.2
      trame_client : 2.9.4
      trame_server : 2.11.7
         trame_vtk : 2.5.8
      nest_asyncio : 1.5.6
```


### Screenshots

_No response_

Discussion:
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/pyvista/pyvista/pull/6525?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyvista) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 97.09%. Comparing base [(`056493f`)](https://app.codecov.io/gh/pyvista/pyvista/commit/056493f9e7b6e9c62a53a7c8012bef37f5dd4cac?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyvista) to head [(`9cb584f`)](https://app.codecov.io/gh/pyvista/pyvista/commit/9cb584f2809df3a11102f2168af9c4bae5880797?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyvista).

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main    #6525      +/-   ##
==========================================
- Coverage   97.38%   97.09%   -0.30%     
==========================================
  Files         143      143              
  Lines       27386    27388       +2     
==========================================
- Hits        26671    26592      -79     
- Misses        715      796      +81     
```

</details>
pyvista-bot: <!-- NETLIFY DEPLOY COMMENT GENERATED BY ACTIONS_NETLIFY - APP ID SHA256: d3574f413fe51079937885070831e027ca5b10f7facb9e609494e0a481a31f79 -->
🚀 Deployed on https://66c0d3664e548998438ced16--pyvista-dev.netlify.app

Patch:
diff --git a/pyvista/core/grid.py b/pyvista/core/grid.py
index d09dd120..25d0d1cf 100644
--- a/pyvista/core/grid.py
+++ b/pyvista/core/grid.py
@@ -652,6 +652,10 @@ class ImageData(Grid, ImageDataFilters, _vtk.vtkImageData):
                [1., 1., 1.]])
 
         """
+        # Handle empty case
+        if not all(self.dimensions):
+            return np.zeros((0, 3))
+
         # Get grid dimensions
         nx, ny, nz = self.dimensions
         nx -= 1


Test patch:
diff --git a/tests/core/test_grid.py b/tests/core/test_grid.py
index 2f06add3..f672c889 100644
--- a/tests/core/test_grid.py
+++ b/tests/core/test_grid.py
@@ -864,6 +864,18 @@ def test_create_image_data_from_specs():
     assert grid != grid_from_grid
 
 
+@pytest.mark.parametrize('dims', [None, (0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1)])
+def test_image_data_empty_init(dims):
+    image = pv.ImageData(dimensions=dims)
+    assert image.n_points == 0
+    assert image.n_cells == 0
+    assert image.area == 0
+    assert image.volume == 0
+
+    points = image.points
+    assert np.array_equal(points, np.zeros((0, 3)))
+
+
 def test_image_data_invald_args():
     with pytest.raises(TypeError):
         pv.ImageData(1)