-
Hi there! I have been struggling for a while on something which seems quite basic but which I haven't been able to figure out so far. I have a list of pickled files in multiple directories. Each pickled file consists of a dictionary with a 2 nparray(512x512) items (CT and RT). Now I want to apply various transformations on just only the CT nparray in the dict. A simplified version of what I am trying to achieve below:
Now I was wondering whether this was possible or whether I would first have to save the CT nparray again as an image. I hope you are able to help me out. Great project by the way! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Something that I have been looking at and which I reckon would be what I am looking for is:
from the GAN_workflow_array tutorial. But I haven't been able to figure it out for my specific use case yet. Again, any help is appreciated |
Beta Was this translation helpful? Give feedback.
-
Hi @PCaesar18 , May I know what's your error message when you try to modify from files = glob.glob(os.path.join(GAN_input_data_folder_name,'**/*.pkl'),recursive = True)
class LoadPickleD(Transform):
def __call__(self, data):
pickleFile = open(data, 'rb')
return pickle.load(pickleFile)
transform = Compose([
LoadPickleD(),
AddChannelD(keys="CT"),
ResizeD(keys="CT", spatial_size=[64, 64]),
ToTensorD(keys="CT"),
])
test_data = CacheDataset(files, transform) Thanks. |
Beta Was this translation helpful? Give feedback.
Hi @PCaesar18 ,
May I know what's your error message when you try to modify from
LoadTarJpeg
? Maybe just change to:Thanks.