<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://www.nitrc.org/themes/nitrc3.0/css/rss.xsl.php?feed=https://www.nitrc.org/export/rss20_forum.php?forum_id=9634" ?>
<?xml-stylesheet type="text/css" href="https://www.nitrc.org/themes/nitrc3.0/css/rss.css" ?>
<rss version="2.0"> <channel>
  <title>NITRC mri_reface Forum: open-discussion</title>
  <link>http://www.nitrc.org/forum/forum.php?forum_id=9634</link>
  <description>General Discussion</description>
  <language>en-us</language>
  <copyright>Copyright 2000-2026 NITRC OSI</copyright>
  <webMaster></webMaster>
  <lastBuildDate>Wed, 15 Jul 2026 16:37:08 GMT</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>NITRC RSS generator</generator>
  <item>
   <title>RE: matlab version </title>
   <link>http://www.nitrc.org/forum/forum.php?thread_id=16015&amp;forum_id=9634</link>
   <description>&amp;lt;p&amp;gt;No, the matlab runtime needs to match the one it was compiled with, but please remember this is the free Matlab runtime, not actual Matlab that you would have to pay for. If you have a system install of a different version, you can still install the needed runtime for this in a separate location.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Chris Schwarz&amp;lt;/p&amp;gt;</description>
   <author>Christopher Schwarz</author>
   <pubDate>Fri, 29 May 2026 13:56:09 GMT</pubDate>
   <guid>http://www.nitrc.org/forum/forum.php?thread_id=16015&amp;forum_id=9634</guid>
  </item>
  <item>
   <title>matlab version </title>
   <link>http://www.nitrc.org/forum/forum.php?thread_id=16015&amp;forum_id=9634</link>
   <description>&amp;lt;p&amp;gt;Hi&amp;amp;nbsp;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;amp;nbsp;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I am trying to use the mri_reface executable and just wanted to ask whether the matlab version can be higher than the one specified?&amp;amp;nbsp;&amp;lt;/p&amp;gt;</description>
   <author>evaneldridge</author>
   <pubDate>Fri, 29 May 2026 13:50:35 GMT</pubDate>
   <guid>http://www.nitrc.org/forum/forum.php?thread_id=16015&amp;forum_id=9634</guid>
  </item>
  <item>
   <title>RE: Changing location for working files</title>
   <link>http://www.nitrc.org/forum/forum.php?thread_id=16006&amp;forum_id=9634</link>
   <description>&amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Originally posted by Christopher Schwarz:&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If your $MCR_CACHE_ROOT on $scratch_dir is shared across multiple jobs, you may run into difficulties where two jobs start at roughly the same time, causing one to delete the cache that the other just unpacked. Ideally you would seed time or jobID into the scratch_dir name to avoid collisions, but 350MB x n jobs may be more scratch than your node has available. It's an unfortunately tricky balance inherent to deployed matlab applications.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Yes, I currently have:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;scratch_dir=/scratch0/${USER}/mri_reface_${JOB_ID}.${SGE_TASK_ID}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;As you say, that means I have multiple copies of the MCR cache, even if they are short-lived. I agree it's a balancing act!&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;</description>
   <author>Paul Wright</author>
   <pubDate>Tue, 19 May 2026 9:24:40 GMT</pubDate>
   <guid>http://www.nitrc.org/forum/forum.php?thread_id=16006&amp;forum_id=9634</guid>
  </item>
  <item>
   <title>RE: Changing location for working files</title>
   <link>http://www.nitrc.org/forum/forum.php?thread_id=16006&amp;forum_id=9634</link>
   <description>&lt;p&gt;If your $MCR_CACHE_ROOT on $scratch_dir is shared across multiple jobs, you may run into difficulties where two jobs start at roughly the same time, causing one to delete the cache that the other just unpacked. Ideally you would seed time or jobID into the scratch_dir name to avoid collisions, but 350MB x n jobs may be more scratch than your node has available. It's an unfortunately tricky balance inherent to deployed matlab applications.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;Our nodes don't have enough scratch to avoid overlaps, so we have this in a wrapper script:&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;while ! stat &quot;$MCR_CACHE_ROOT&quot; &amp;gt; /dev/null 2&amp;gt;&amp;amp;1; do&lt;br&gt;&amp;nbsp; &amp;nbsp; echo &quot;Waiting for $MCR_CACHE_ROOT to be accessible...&quot;&lt;br&gt;&amp;nbsp; &amp;nbsp; sleep 1 &amp;nbsp;# Wait 1 second before checking again&lt;br&gt;done&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
   <author>Christopher Schwarz</author>
   <pubDate>Fri, 15 May 2026 13:28:49 GMT</pubDate>
   <guid>http://www.nitrc.org/forum/forum.php?thread_id=16006&amp;forum_id=9634</guid>
  </item>
  <item>
   <title>Changing location for working files</title>
   <link>http://www.nitrc.org/forum/forum.php?thread_id=16006&amp;forum_id=9634</link>
   <description>&amp;lt;p&amp;gt;I'm running mri_reface on a cluster via Sun Grid Engine. I want to use scratch space for working files instead of the /tmp/$tempdir and ~/.mcrCache9.12 cache directories mri_reface uses by default.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can achieve this by setting environment variables to something like:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;TMPDIR=&amp;quot;${scratch_dir}/tmp&amp;quot;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;MCR_CACHE_ROOT=&amp;quot;${scratch_dir}/mcr_cache&amp;quot;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I am running using singularity, so I set these using the `--env` argument in the `singularity run` command.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;It's probably not a big deal, since mri_reface does not write much to /tmp, and I think it deletes it afterwards, and the MCR cache is about 350 MB, not enough to threaten even the small quota my home directory gets on our server. I have done any rigorous testing to see if it improves speed on my cluster. I thought I'd share in case it saves anyone else a little time.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;amp;nbsp;&amp;lt;/p&amp;gt;</description>
   <author>Paul Wright</author>
   <pubDate>Wed, 13 May 2026 13:27:20 GMT</pubDate>
   <guid>http://www.nitrc.org/forum/forum.php?thread_id=16006&amp;forum_id=9634</guid>
  </item>
  <item>
   <title>RE: Trying Docker version</title>
   <link>http://www.nitrc.org/forum/forum.php?thread_id=14364&amp;forum_id=9634</link>
   <description>&amp;lt;p&amp;gt;We ask that people do not redistribute the program on Dockerhub. Any versions on Dockerhub are not official. Please use the official Docker images hosted here.&amp;amp;nbsp;&amp;lt;/p&amp;gt;</description>
   <author>Christopher Schwarz</author>
   <pubDate>Mon, 09 Dec 2024 19:04:16 GMT</pubDate>
   <guid>http://www.nitrc.org/forum/forum.php?thread_id=14364&amp;forum_id=9634</guid>
  </item>
  <item>
   <title>RE: Trying Docker version</title>
   <link>http://www.nitrc.org/forum/forum.php?thread_id=14364&amp;forum_id=9634</link>
   <description>&amp;lt;p&amp;gt;Hello,&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Just wondering if there is still no Docker image on DockerHub&amp;lt;/p&amp;gt;</description>
   <author>Sun Sar</author>
   <pubDate>Mon, 09 Dec 2024 19:00:13 GMT</pubDate>
   <guid>http://www.nitrc.org/forum/forum.php?thread_id=14364&amp;forum_id=9634</guid>
  </item>
  <item>
   <title>RE: Trying Docker version</title>
   <link>http://www.nitrc.org/forum/forum.php?thread_id=14364&amp;forum_id=9634</link>
   <description>&amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Originally posted by Adam Raikes:&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I haven't seen any resolution to this issue, but wanted to give my experience.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I created a Singularity container from the current Docker image for use with the system I have access to. Binding the updated ADIR_nii2dicom.py as /usr/bin/mlrtapp/image_handling/ADIR_nii2dicom.py solved this problem for us.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Adam,&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I'm sorry you had to do that. I was waiting for confirmation from Dianne and largely forgot about this.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Today I released a new version 0.3.3 that includes this fix (and some other unrelated ones).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Thanks,&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Chris&amp;lt;/p&amp;gt;</description>
   <author>Christopher Schwarz</author>
   <pubDate>Fri, 17 Nov 2023 22:45:51 GMT</pubDate>
   <guid>http://www.nitrc.org/forum/forum.php?thread_id=14364&amp;forum_id=9634</guid>
  </item>
  <item>
   <title>RE: Trying Docker version</title>
   <link>http://www.nitrc.org/forum/forum.php?thread_id=14364&amp;forum_id=9634</link>
   <description>&amp;lt;p&amp;gt;I haven't seen any resolution to this issue, but wanted to give my experience.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I created a Singularity container from the current Docker image for use with the system I have access to. Binding the updated ADIR_nii2dicom.py as /usr/bin/mlrtapp/image_handling/ADIR_nii2dicom.py solved this problem for us.&amp;lt;/p&amp;gt;</description>
   <author>Adam Raikes</author>
   <pubDate>Thu, 02 Nov 2023 18:44:24 GMT</pubDate>
   <guid>http://www.nitrc.org/forum/forum.php?thread_id=14364&amp;forum_id=9634</guid>
  </item>
  <item>
   <title>RE: Trying Docker version</title>
   <link>http://www.nitrc.org/forum/forum.php?thread_id=14364&amp;forum_id=9634</link>
   <description>&amp;lt;p&amp;gt;Dianne,&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Thanks for posting the steps you followed. I followed your steps to create the updated image and I called it mri_reface2, as you did. I then exited and went into mri_reface2 in a new terminal and verified that the updated copy of ADIR_nii2dicom.py was still there.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;$ docker run -ti mri_reface2&amp;lt;br&amp;gt;root@55793afdac4c:/usr/bin/mlrtapp/image_handling# grep xml ADIR_nii2dicom.py&amp;amp;nbsp;&amp;lt;br&amp;gt;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; dcmfiles_temp = [i for i in dcmfiles_temp if not re.search(r'\.xml$', i) ]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The above grep result matches the code I added newly in the revision I attached previously.&amp;amp;nbsp;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I created a new run_mri_reface_docker.sh&amp;amp;nbsp;&amp;lt;br&amp;gt;$ cp run_mri_reface_docker.sh run_mri_reface2_docker.sh&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Which I then edited to replace mri_reface with mri_reface2 in BOTH docker lines:&amp;lt;br&amp;gt;96 docker run -ti --mount type=bind,src\=$tmpdir,target=$tmpdir mri_reface2 run_mri_reface.sh $input $output_tmp ${input_array[@]:2 }&amp;lt;br&amp;gt;97&amp;amp;nbsp;&amp;lt;br&amp;gt;98 docker run -ti --mount type=bind,src=$tmpdir,target=$tmpdir mri_reface2 chmod =777 -R $tmpdi&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;From there I ran it two ways. One was using run_mri_reface2_docker.sh:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;$ ./run_mri_reface2_docker.sh dcm_t1 outExternal -imType T1&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;[...]&amp;lt;br&amp;gt;ADIR_ReFace finished in: 17.9749 minutes&amp;lt;br&amp;gt;Finished writing 176 dcm files to outDir: /tmp/tmp.A1n3Oz3nih/outputs/dcm&amp;lt;br&amp;gt;Including custom code sequence: code: &amp;quot;replace_recognizable&amp;quot; meaning: &amp;quot;Replace face, ears, and artifacts in air&amp;quot; designator: &amp;quot;mri_reface&amp;quot; version: &amp;quot;0.3.2&amp;quot;&amp;lt;br&amp;gt;Finished.&amp;lt;br&amp;gt;De-faced DICOM was written to /tmp/tmp.A1n3Oz3nih/outputs/dcm. This DICOM metadata is NOT otherwise de-identified. Only de-facing was performed. If you need the meta-data de-identified also, you should run it through your preferred DICOM de-identification software.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;When it completed, I opened outExternal/dcm and the files are present and successful.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I also tried running the whole thing inside docker, rather than using run_mri_reface2_docker.sh&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;$ chmod a+wrX .&amp;lt;br&amp;gt;$ docker run -ti --mount type=bind,src=${PWD},target=/host mri_reface2&amp;lt;br&amp;gt;root@23aadd07062d:/usr/bin/mlrtapp/image_handling# cd /host&amp;lt;br&amp;gt;root@23aadd07062d:/host# run_mri_reface.sh dcm_t1 out2 -imType T1&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;[...]&amp;lt;br&amp;gt;ADIR_ReFace finished in: 17.8532 minutes&amp;lt;br&amp;gt;Finished writing 176 dcm files to outDir: out2/dcm&amp;lt;br&amp;gt;Including custom code sequence: code: &amp;quot;replace_recognizable&amp;quot; meaning: &amp;quot;Replace face, ears, and artifacts in air&amp;quot; designator: &amp;quot;mri_reface&amp;quot; version: &amp;quot;0.3.2&amp;quot;&amp;lt;br&amp;gt;Finished.&amp;lt;br&amp;gt;De-faced DICOM was written to out2/dcm. This DICOM metadata is NOT otherwise de-identified. Only de-facing was performed. If you need the meta-data de-identified also, you should run it through your preferred DICOM de-identification software.&amp;lt;br&amp;gt;root@23aadd07062d:/host# exit&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Then I checked out2/dcm. The dcm files are present and valid.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I tried again using your dicom directory name, just in case that had something to do with it:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;$ ./run_mri_reface2_docker.sh T1_mprage_1mm_13/ out -imType T1&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;And that was also successful.&amp;amp;nbsp;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;From here, I was at a bit of a loss. My best guess was that there's a mistake in one of the steps you didn't show me. Maybe you could verify that your mri_reface2 image has the updated code (via the above grep example), and you could verify that your run_mri_reface2_docker.sh replaced 'mri_reface' in BOTH 'docker' commands with 'mri_reface2'?&amp;amp;nbsp;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Toward that hypothesis, I looked back at the start of your pdf and I think you may not have replaced the correct file/path.&amp;amp;nbsp;&amp;lt;br&amp;gt;/usr/bin/mlrtapp has ADIR_nii2dicom, a program. It also has a subdirectory called image_handling. Inside image_handling is ADIR_nii2dicom.py. I intended for you to replace /usr/bin/mlrtapp/image_handling/ADIR_nii2dicom.py, NOT /usr/bin/mlrtapp/ADIR_nii2dicom, but it looks like you replaced ADIR_nii2dicom. I surprised that didn't up with a new error message when you tried to run it that way, but otherwise I think this explains why it's now working for me, but not you.&amp;amp;nbsp;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Can you please try starting again from the original mri_reface image and copy the new ADIR_nii2dicom.py into image_handling, this time? From there, I hope it will work for you. Please let me know. Sorry my original instructions weren't clear enough about which file to replace.&amp;amp;nbsp;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Thanks,&amp;lt;br&amp;gt;Chris&amp;lt;/p&amp;gt;</description>
   <author>Christopher Schwarz</author>
   <pubDate>Tue, 13 Jun 2023 0:30:34 GMT</pubDate>
   <guid>http://www.nitrc.org/forum/forum.php?thread_id=14364&amp;forum_id=9634</guid>
  </item>
 </channel>
</rss>
