<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SegmentMeanShift function requires Output Raster Dataset? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/segmentmeanshift-function-requires-output-raster/m-p/639251#M49835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am fairly new to using ArcGIS Pro,&amp;nbsp;but I am slightly experienced in Python in general. I'm not sure if this is the exact place to post this question, but I am stuck. I have successfully used ArcPy to clip a raster from a shapefile, and I now want to perform the SegmentMeanShift() function on said clipped raster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This process works in ArcGIS Pro, and I would like to have a script to automate this process for many different rasters. Below is the snippet of my code that gives me issues (most of it was copied from the documentation&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/segment-mean-shift.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# script to clip and segment a raster&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# import libraries&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; matplotlib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;pyplot &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; plt
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; numpy &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; np
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sa &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#%% Clip raster&lt;/SPAN&gt;
in_ras &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"data\s20180403.tif"&lt;/SPAN&gt;
clip_ras &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; in_ras&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"clip_ras\\"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; in_ras&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"_clip.tif"&lt;/SPAN&gt;
feature_template &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"shapefiles\square_domain_0723.shp"&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Clip_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
        in_ras&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; "&lt;SPAN class="comment token"&gt;#", clip_ras, feature_template, "0", "ClippingGeometry")&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#%% Segment raster&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#check for spatial analyst license&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckOutExtension&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# segment mean shift the clipped raster                 &lt;/SPAN&gt;
spec_detail &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10"&lt;/SPAN&gt;
spat_detail &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10"&lt;/SPAN&gt;
min_seg_size &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"20"&lt;/SPAN&gt;
band_indexes &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"1"&lt;/SPAN&gt;
seg_clip_ras &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"data\\seg_clip_ras\\"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"s20180403"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_clip_seg.tif"&lt;/SPAN&gt;

seg_ras &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; SegmentMeanShift&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_ras&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; spec_detail&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                           spat_detail&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; min_seg_size&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; band_indexes&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
seg_ras&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;seg_clip_ras&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The output I receive from running this chunk of the script is:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Traceback (most recent call last):

  File "&amp;lt;ipython-input-33-232592bd359c&amp;gt;", line 11, in &amp;lt;module&amp;gt;
    spat_detail, min_seg_size, band_indexes)

  File "D:\ArcGISPro\Resources\ArcPy\arcpy\sa\Functions.py", line 7768, in SegmentMeanShift
    band_indexes)

  File "D:\ArcGISPro\Resources\ArcPy\arcpy\sa\Utils.py", line 53, in swapper
    result = wrapper(*args, **kwargs)

  File "D:\ArcGISPro\Resources\ArcPy\arcpy\sa\Functions.py", line 7761, in Wrapper
    band_indexes)

  File "D:\ArcGISPro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 506, in &amp;lt;lambda&amp;gt;
    return lambda *args: val(*gp_fixargs(args, True))

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000735: Output Raster Dataset: Value is required
Failed to execute (SegmentMeanShift).&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am unsure what is happening here, when I try to add another argument, the error says that SegmentMeanShift() only takes 5 arguments, not 6, which makes sense and is what I thought originally. So why is a value required for Output Raster Dataset?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, when this script is finished, I would like a raster saved in my directory that is clipped and segmented from the first raster. I have looked over the documentation and other questions and I cannot seem to find this specific issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for help in advance, I have been stuck on this for awhile now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 03:09:45 GMT</pubDate>
    <dc:creator>JosephFogarty</dc:creator>
    <dc:date>2021-12-12T03:09:45Z</dc:date>
    <item>
      <title>SegmentMeanShift function requires Output Raster Dataset?</title>
      <link>https://community.esri.com/t5/python-questions/segmentmeanshift-function-requires-output-raster/m-p/639251#M49835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am fairly new to using ArcGIS Pro,&amp;nbsp;but I am slightly experienced in Python in general. I'm not sure if this is the exact place to post this question, but I am stuck. I have successfully used ArcPy to clip a raster from a shapefile, and I now want to perform the SegmentMeanShift() function on said clipped raster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This process works in ArcGIS Pro, and I would like to have a script to automate this process for many different rasters. Below is the snippet of my code that gives me issues (most of it was copied from the documentation&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/segment-mean-shift.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# script to clip and segment a raster&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# import libraries&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; matplotlib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;pyplot &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; plt
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; numpy &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; np
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sa &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#%% Clip raster&lt;/SPAN&gt;
in_ras &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"data\s20180403.tif"&lt;/SPAN&gt;
clip_ras &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; in_ras&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"clip_ras\\"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; in_ras&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"_clip.tif"&lt;/SPAN&gt;
feature_template &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"shapefiles\square_domain_0723.shp"&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Clip_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
        in_ras&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; "&lt;SPAN class="comment token"&gt;#", clip_ras, feature_template, "0", "ClippingGeometry")&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#%% Segment raster&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#check for spatial analyst license&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckOutExtension&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# segment mean shift the clipped raster                 &lt;/SPAN&gt;
spec_detail &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10"&lt;/SPAN&gt;
spat_detail &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10"&lt;/SPAN&gt;
min_seg_size &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"20"&lt;/SPAN&gt;
band_indexes &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"1"&lt;/SPAN&gt;
seg_clip_ras &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"data\\seg_clip_ras\\"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"s20180403"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_clip_seg.tif"&lt;/SPAN&gt;

seg_ras &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; SegmentMeanShift&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_ras&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; spec_detail&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                           spat_detail&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; min_seg_size&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; band_indexes&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
seg_ras&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;seg_clip_ras&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The output I receive from running this chunk of the script is:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Traceback (most recent call last):

  File "&amp;lt;ipython-input-33-232592bd359c&amp;gt;", line 11, in &amp;lt;module&amp;gt;
    spat_detail, min_seg_size, band_indexes)

  File "D:\ArcGISPro\Resources\ArcPy\arcpy\sa\Functions.py", line 7768, in SegmentMeanShift
    band_indexes)

  File "D:\ArcGISPro\Resources\ArcPy\arcpy\sa\Utils.py", line 53, in swapper
    result = wrapper(*args, **kwargs)

  File "D:\ArcGISPro\Resources\ArcPy\arcpy\sa\Functions.py", line 7761, in Wrapper
    band_indexes)

  File "D:\ArcGISPro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 506, in &amp;lt;lambda&amp;gt;
    return lambda *args: val(*gp_fixargs(args, True))

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000735: Output Raster Dataset: Value is required
Failed to execute (SegmentMeanShift).&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am unsure what is happening here, when I try to add another argument, the error says that SegmentMeanShift() only takes 5 arguments, not 6, which makes sense and is what I thought originally. So why is a value required for Output Raster Dataset?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, when this script is finished, I would like a raster saved in my directory that is clipped and segmented from the first raster. I have looked over the documentation and other questions and I cannot seem to find this specific issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for help in advance, I have been stuck on this for awhile now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:09:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/segmentmeanshift-function-requires-output-raster/m-p/639251#M49835</guid>
      <dc:creator>JosephFogarty</dc:creator>
      <dc:date>2021-12-12T03:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: SegmentMeanShift function requires Output Raster Dataset?</title>
      <link>https://community.esri.com/t5/python-questions/segmentmeanshift-function-requires-output-raster/m-p/639252#M49836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;seg_clip_ras &lt;/SPAN&gt;&lt;SPAN style="background-attachment: scroll; background-clip: border-box; background-color: rgba(255, 255, 255, 0.5); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #a67f59; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none currentColor;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; r&lt;/SPAN&gt;&lt;SPAN style="border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #669900; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none currentColor;"&gt;"data\\seg_clip_ras\\"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="background-attachment: scroll; background-clip: border-box; background-color: rgba(255, 255, 255, 0.5); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #a67f59; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none currentColor;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #669900; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none currentColor;"&gt;"s20180403"&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="background-attachment: scroll; background-clip: border-box; background-color: rgba(255, 255, 255, 0.5); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #a67f59; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none currentColor;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #669900; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none currentColor;"&gt;"_clip_seg.tif"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;your path... what does 'data' refer to? or are you just anonymizing your actual path? (ie you have no drive specification, if you are working locally)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2019 10:16:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/segmentmeanshift-function-requires-output-raster/m-p/639252#M49836</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-07-17T10:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: SegmentMeanShift function requires Output Raster Dataset?</title>
      <link>https://community.esri.com/t5/python-questions/segmentmeanshift-function-requires-output-raster/m-p/639253#M49837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. 'data' simple refers to a folder named data. I have&amp;nbsp;created an environment after I imported the libraries in the code above, something along the lines of:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"D:\my\project\path"&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but I have omitted this line for anonymity. Yes, I am working locally on my computer. I think the path works fine, because the program is able to clip the raster, but not segment it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2019 14:44:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/segmentmeanshift-function-requires-output-raster/m-p/639253#M49837</guid>
      <dc:creator>JosephFogarty</dc:creator>
      <dc:date>2019-07-17T14:44:09Z</dc:date>
    </item>
  </channel>
</rss>

