How do i write data to a specfic path without using cd(path)?

2 vues (au cours des 30 derniers jours)
Hugo
Hugo le 10 Fév 2014
Commenté : Jos (10584) le 10 Fév 2014
Hi all,
I want to save data using dicomwrite, does anyone now how i can use a specific path in the dicomwriteline?
so i want to use something like: fpath = uigetdir; dicomwrite (fpath, serie, name, info)
how should i do this?

Réponse acceptée

Mischa Kim
Mischa Kim le 10 Fév 2014
Modifié(e) : Mischa Kim le 10 Fév 2014
Hugo, try
dicomwrite(X, strcat(uigetdir,'myfilename.dcm'));
where X represents the image to be written. Of course, you can replace the hard-coded filename with any valid string variable.
  2 commentaires
Hugo
Hugo le 10 Fév 2014
Thanks a lot
Jos (10584)
Jos (10584) le 10 Fév 2014
Pathnames are OS specific (e.g. windows uses backslash while decent operating systems use a forward slash). To concatenate directories and files, independent of OS, you are advised to use FULLPATH
directoryName = uigetdir
fullname = fullpath(directoryName, FileName)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by