NRRD Segmentation To Numpy problem

Hi, All
I have .nrrd files of segmentations, so I only have 2 classes.
but not all each file have 2 classes, I can say that most of them are one class for one file.

then let’s talk about my problem.
I try to take segmentations to NumPy array in Python. but when it has one class in the file. It will assume that the class is value 1 by not caring class name or class color.
then I try another way but it did not work.

I try these ways.

  1. try to read nrrd. But when it has on class on file. that class will be value 1.

  1. try to convert nrrd to tiff images using Python. But the image has some transformation from the original.

  1. try to convert nrrd to tif stack using 3D Slicer. But like no.1.

  1. try to convert nrrd to dcm files using 3D Slicer. But like no.1.

Can someone help me, All I need is class A value is 1. Class B value is 2. even if it has one class on that file.
So all 2 classes on files work as well.

Or I do something wrong ;-;.

thank you a lot.

Should I do it manually?
Map the file name and class on my csv then change its value.