Comments (4)
I don't know if I understand correctly... you would like to dump your data to disk right after it gets transformed (pre-processed).
You can do that by creating a new transformation:
import uuid
class DumpAsNumpy:
def __init__(self, fields, path):
self.fields = fields
self.path = path
def __call__(self, data):
for field in self.fields:
f_name = str(uuid.uuid4())
numpy.save(data[field], os.path.join(self.path, f_name)
data[self.field + '_file'] = f_name
return data
from eisen-core.
Of course this additional transform that dumps data to disk might not have exactly this form. But one instance of this object could be part of the transform chain and therefore save copied of data on the disk.
from eisen-core.
thanks so much!! I make some confusion I'm interested to use the data normalizated from you tool for extract radiomics. So, I wan to integrate deep learning model with radiomics. I just wondering how to save the data after trasformation on nifty format.
I have tried this code:
tform = Compose([
read_tform,
resample_tform,
to_numpy_tform,
crop,
map_intensities,
threshold_labels,
add_channel,
DumpAsNumpy(fields=['image', 'label'],path="tmp/")
])
dataset = MSDDataset(
PATH_DATA,
NAME_MSD_JSON,
'training',
transform=tform
)
I miss something .. how can save?
from eisen-core.
you would need to write one more transformation which DumpsAsNifti. Right now DumpAsNumpy will dump files into the ./tmp folder (not into /tmp, because you didn't specify '/tmp' but 'tmp/' instead) in numpy format.
from eisen-core.
Related Issues (11)
- Testing and exporting commands HOT 8
- tensorboard summary confusion matrix looks bad for binary labels HOT 3
- How to setup for non-binary segmentation (background, organ and tumor) HOT 7
- Support Running Metric Computation HOT 4
- Add random spatial and intensity transforms HOT 13
- convert_output_dict_to_cpu removes metrics if they return scalars
- TrainingAMP issues HOT 1
- workflow is taking up more memory and time than it needs to
- Question on transformers models HOT 3
- Eisen Pytorch and CUDA version problem! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eisen-core.