docstr: Test init with custom filter and assert wrong filter shape throws an error
docstr_tok: ["Test","init","with","custom","filter","and","assert","wrong","filter","shape","throws","an","error"]
code: def test_init_from_array(self):
      "Test init with custom filter and assert wrong filter shape throws an error"
      _ = ImageFilter(torch.ones(3, 3))
      _ = ImageFilter(torch.ones(3, 3, 3))
      _ = ImageFilter(np.ones((3, 3)))
      _ = ImageFilter(np.ones((3, 3, 3)))
  
      with self.assertRaises(Exception) as context:
          _ = ImageFilter(torch.ones(3, 3, 3, 3))
          self.assertTrue(
              "Only 1D, 2D, and 3D filters are supported."
              in str(context.output)
          )
  
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.networks.layers.simplelayers import GaussianFilter
  from monai.transforms import ImageFilter, ImageFilterd, RandImageFilter, RandImageFilterd
label_desc: Use image node_id 3 for calling the TestImageFilter obj's underlying member method code with example usage: obj.test_init_from_array() without return types