def METHOD_NAME(tmp_path, data_dtype):
    infile = get_test_data(fname='anatomical.nii')
    outfile = tmp_path / 'output.nii.gz'
    orig = nib.load(infile)
    assert not outfile.exists()
    # np.dtype() will give us the dtype for the system endianness if that
    # mismatches the data file, we will fail equality, so get the dtype that
    # matches the requested precision but in the endianness of the file
    expected_dtype = np.dtype(data_dtype).newbyteorder(orig.header.endianness)
    convert.main([str(infile), str(outfile), '--out-dtype', data_dtype])
    assert outfile.is_file()
    converted = nib.load(outfile)
    assert np.allclose(converted.affine, orig.affine)
    assert converted.shape == orig.shape
    assert converted.get_data_dtype() == expected_dtype